Clean up custom polling in ZHA device and light#32653
Clean up custom polling in ZHA device and light#32653dmulcahey merged 19 commits intohome-assistant:devfrom
Conversation
|
Hey there @Adminiuga, mind taking a look at this pull request as its been labeled with a integration ( |
92be06c to
9720779
Compare
|
Set |
|
btw the default for async integrations is to set parallel updates to 0, assuming you have your own locking mechanism inside the lib. |
| } | ||
|
|
||
|
|
||
| @asynctest.mock.patch( |
There was a problem hiding this comment.
The diff will be smaller in the future, when we reach Python 3.8 as minimum version and can replace asynctest with std lib again, if we import patch from asynctest.
There was a problem hiding this comment.
Will we address this later in a future PR?
There was a problem hiding this comment.
Yes. I’d like to get this PR into the beta release
|
@MartinHjelmare I am merging this PR now and i'll immediately follow up with another to change that import and cleanup something else you caught after an earlier PR. I want to ensure this PR hits the beta. Thanks for all that you do and for engaging in good discussion! |
Proposed change
This PR cleans up custom polling usage in the ZHA device and in the ZHA light entity class. In device we weren't cleaning up the timer when the device was removed from HA.
In the light entity we had a few issues:
PARALLEL_UPDATESeven thoughshould_pollis false. I leftPARALLEL_UPDATESin light.py at this point but I think it should be removed or cranked way up. I think this only applies toasync_updatecalls from polling which is disabled and toupdate_before_add=Truecalls when adding entities. Considering all this does is a cache read in memory maybe we should crank the # up in another PR? @balloob @MartinHjelmare any guidance you can offer on this would be appreciated.SCAN_INTERVALfor our custom polling interval - this could be misleading to someone looking at the integrationThis PR corrects the above issues.
This PR also fixes writing state to the HA state machine based on this comment: #32291 (comment) This should remove a bunch of unnecessary awaits from ZHA.
Type of change
Example entry for
configuration.yaml:# Example configuration.yamlChecklist
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: