-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement external state restoration (#58)
* Consolidate init-time state reading for Light entity * Read the color mode from cache as well * Remove duplicate `supported_color_modes` variable * Switch `zcl_color_mode_to_entity_color_mode` to a static dictionary * Only set the color mode from the supported color modes if it is uncached * Update the attribute cache color mode after the color has been successfully set * Do not persist the color mode for groups * Test that the color mode changes * Account for invalid ZCL color modes * Add a quick test for HS * Unit test enhanced hue as well * Re-introduce erroneously removed `cached_property` * Add `restore_extra_state_attributes` * Persist the door lock state after locking/unlocking * Remove unused lock `kwargs` * Add `restore_external_state_attributes` * Implement external state for `cover` * Implement external state for `select` * Implement external state for `siren` * Remove unnecessary `_persist_lock_state` * Revert "Implement external state for `siren`" This reverts commit 7ef8ba3. * Implement a stub `restore_external_state_attributes` for non-ZCL selects * Migrate coverage to `pyproject.toml` and exclude NotImplementedError * Update zha/application/platforms/light/__init__.py Co-authored-by: TheJulianJES <[email protected]> * Migrate lighting to use explicit state restoration instead of ZCL cache * Reduce diff size * Only restore the state if the attribute isn't `None` * Migrate lock to use state restoration * Add some unit tests * Offload validation to Core * Implement an `undefined` type * Migrate remaining platforms to use `UNDEFINED` as well, where appropriate * Finish unit tests * Remove `UNDEFINED` * Only restore (most) light state attributes if they are not `None` * Fix `number` entity name * Revert `cached_property` -> `property` change --------- Co-authored-by: TheJulianJES <[email protected]>
- Loading branch information
1 parent
4fbc162
commit 8abf678
Showing
15 changed files
with
290 additions
and
23 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
codecov | ||
coverage[toml] | ||
colorlog | ||
codespell | ||
mypy | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.