-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
Add quality scale for Sonos #144928
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Add quality scale for Sonos #144928
Conversation
Hey there @jjlawren, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add the things we agree on to the comments and get this merged and improve from there
@@ -0,0 +1,73 @@ | |||
rules: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@property
def extra_state_attributes(self) -> dict[str, Any]:
"""Return entity specific state attributes."""
return {
ATTR_BATTERY_POWER_SOURCE: self.speaker.power_source,
}
in binary sensor, could we make this a full fledged sensor? I have a roam with both wireless charging and usb-c, so I think we can create a complete list for that one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about the media player attributes?
@@ -0,0 +1,73 @@ | |||
rules: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want to store the entities in another place other than passing them onto async_add_entities
self.hass.data[DATA_SONOS].entity_id_mappings[self.entity_id] = self.speaker
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This data is used in async_join_players to go from the entity_id to the associated speaker object. I believe the speaker is the device; so instead we could go to the entity_registry and get the device and lookup the speaker from the device_id.
I have a branch where I'm moving all of DATA_SONOS to runtime data on the config_entry. Tests are passing and starting to do run-time validation. There alot of small changes.
A sequence could be
a) move to runtime data
b) address this comment in a seperate PR
c) address the tests that access hass.data (which will now be runtime data) in a seperate PR
or alternatively we could address this comment first; then do the move to runtime data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think either way works
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unique-config-entry: | ||
status: exempt | ||
comment: | | ||
Only allows a single entry |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also set single_config_entry in the manifest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok. will try that. when I marked it as done the CI fails since it doesn't detect the right exception being raised.
status: exempt | ||
comment: | | ||
No authentication | ||
test-coverage: todo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some tests are using internals
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. That needs to be fixed.
status: exempt | ||
comment: | | ||
No authentication | ||
test-coverage: todo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test_async_poll_manual_hosts_5
why do we set the total second to 0.5 to only sleep 0.5 seconds. Can't we then just sleep the original time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can fix this.
Looks like a change was made to add async_fire_time_changed (probably to make the test more reliable) and the interval was left.
status: exempt | ||
comment: | | ||
No authentication | ||
test-coverage: todo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test_play_media_library
ideally we don't have if statements in the tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree
status: exempt | ||
comment: | | ||
No authentication | ||
test-coverage: todo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason test_sensor
is testing both binary sensor and sensor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can break it apart
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Proposed change
Add quality_scale.yaml for Sonos to assess current state (not bronze.) And to help prioritize work to get it to bronze.
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.To help with the load of incoming pull requests: