Songpal code and test improvement#35318
Conversation
MartinHjelmare
left a comment
There was a problem hiding this comment.
Thanks! Looks good!
The test failure is unrelated.
|
I'm still working on adding some tests for the service calls. Should be done today. |
|
@MartinHjelmare I think the integration is now good for "gold" integration quality. Can you double check if I missed anything? Also, I'm not pretty sure what the "Uses aiohttp and allows passing in websession" means in the "platinum" quality scale. Do you have any idea where I should look at? |
|
Please copy the bullet list of the integration quality scale here and make a comment for each criteria. All may not apply etc. https://developers.home-assistant.io/docs/integration_quality_scale_index |
There was a problem hiding this comment.
I did just a very brief read-through and to me this looks good (I'm not knowledgeable enough to judge the test improvements, but more testing the better), thanks for the improvements!
About the removal of polling; this will/may break it for some users, as not all devices support the websocket interface. Are you sure we want to do that just to gain "gold status"? Alas, I cannot recall the details, but I think I added support for xhrpost (rytilahti/python-songpal@4b96e30) after getting some feedback just after the initial inclusion to homeassistant. It could have also been that the "xhrpost-only" devices were only sony bravia televisions which are unsupported anyway, so maybe this doesn't affect any real users..
This means that the backend library should be modified to allow passing |
|
@rytilahti The |
|
Ohhhkay, no need to support polling then at all, all the better! I suppose (or hope) that the polling information got read from the config file at some point in the past, though.. |
|
If the library uses aiohttp it should accept an (optional) client session, to meet the criteria, yes. |
Silver 🥈
Gold 🥇
|
|
Box number one means that the config should be centralized with either a config schema in the base integration module and/or by using config entries. So you can check that one too. |
MartinHjelmare
left a comment
There was a problem hiding this comment.
The gold level is approved. 🎉
|
@MartinHjelmare @rytilahti Thanks a lot for the review. 👍 |
Breaking change
To call
songpal/set_sound_settingon all songpal devices, theentity_idnow need to be set toallinstead of left unset.Proposed change
Following reviews by @MartinHjelmare in #34714, here are some code improvements including the test import and service registration.
Type of change
Example entry for
configuration.yaml:# Example configuration.yamlAdditional information
Checklist
black --fast 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..coveragerc.The integration reached or maintains the following Integration Quality Scale: