(DO NOT MERGE) WIP - Update devices in ZHA storage at intervals#33376
(DO NOT MERGE) WIP - Update devices in ZHA storage at intervals#33376dmulcahey wants to merge 4 commits intohome-assistant:devfrom
Conversation
|
Hey there @Adminiuga, mind taking a look at this pull request as its been labeled with a integration ( |
|
Maybe should wait till #33358 goes through? |
Definitely
It does leverage that internally. The store itself needs to be updated first which is what happens here at 15 minute intervals which will schedule the write to disk. The save delay you reference is to prevent multiple writes of storage to disk within a short period (10 seconds). Each update to the store will reset that timer and then when there are no updates for 10 seconds it will write to disk. EDIT |
|
Hrm... this may not work around the race condition |
|
Def still a race condition... 1st time a single test failed in the entire suite with the original exception this was intended to fix... Closed the PR and reopened it so it would rebuild and it passed. |
Proposed change
This PR fixes the exceptions that ZHA tests were throwing. There was a race condition caused by explicitly saving devices in ZHA storage on the HA stop event while the storage itself was in process of flushing its state. We now write the devices to storage at a 15 minute interval.
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: