Skip to content

Add snapcast latency attribute and service#34126

Merged
MartinHjelmare merged 11 commits into
home-assistant:devfrom
BarrettLowe:SnapcastLatency
Apr 14, 2020
Merged

Add snapcast latency attribute and service#34126
MartinHjelmare merged 11 commits into
home-assistant:devfrom
BarrettLowe:SnapcastLatency

Conversation

@BarrettLowe
Copy link
Copy Markdown
Contributor

@BarrettLowe BarrettLowe commented Apr 13, 2020

Proposed change

This allows users to set latency of snapcast devices. This is useful when connecting higher latency devices to the snapcast system. Users can now write automations to adjust the latency of all connected devices if a slow device joins etc.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

@homeassistant
Copy link
Copy Markdown
Contributor

Hi @BarrettLowe,

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@BarrettLowe
Copy link
Copy Markdown
Contributor Author

Can someone tell me why I'm getting errors in the codecov/patch check? Looks like it's complaining about files that I didn't touch. Also I think I fixed my cla-error

Comment thread homeassistant/components/snapcast/media_player.py Outdated
Comment thread homeassistant/components/snapcast/media_player.py Outdated
Comment thread homeassistant/components/snapcast/media_player.py
@MartinHjelmare MartinHjelmare changed the title Implemented snapcast latency attributes Add snapcast latency attribute and service Apr 13, 2020
@MartinHjelmare
Copy link
Copy Markdown
Member

In .coveragerc, exclude all snapcast modules in the snapcast package with a star:

homeassistant/components/snapcast/media_player.py

Updated how entity services get called - now conforms to most
current method
Comment thread homeassistant/components/snapcast/media_player.py Outdated
Comment thread homeassistant/components/snapcast/__init__.py Outdated
Comment thread homeassistant/components/snapcast/media_player.py Outdated
Comment thread homeassistant/components/snapcast/media_player.py Outdated
Comment thread homeassistant/components/snapcast/media_player.py Outdated
Comment thread homeassistant/components/snapcast/media_player.py Outdated
Moved constants into separate file
Removed unnecessary logger message
Remove unnecessary schemas
BarrettLowe and others added 2 commits April 13, 2020 23:12
Better - use next()

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
Comment thread homeassistant/components/snapcast/media_player.py
Comment thread homeassistant/components/snapcast/media_player.py Outdated
@BarrettLowe
Copy link
Copy Markdown
Contributor Author

What's the best way to run the CI tests locally? I'm using the dev container in vscode. Preferably, I could only run the formatting tools on whatever files I've changed for efficiency... Thanks

@MartinHjelmare
Copy link
Copy Markdown
Member

MartinHjelmare commented Apr 14, 2020

In vscode I set up the formatter to auto format on save.

To run tests I run pytest in the terminal from the project root. Specify the test package of the integration as an argument to pytest to just run those tests.

We also have the script script/lazytox.py which runs some of the CI tests locally on just the modified files.

Copy link
Copy Markdown
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@MartinHjelmare MartinHjelmare merged commit ba394fd into home-assistant:dev Apr 14, 2020
@BarrettLowe BarrettLowe deleted the SnapcastLatency branch April 14, 2020 21:27
@lock lock Bot locked and limited conversation to collaborators Apr 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants