mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-12-22 04:30:14 +00:00
Handle module errors more robustly and add query params to light preset and transition (#1043)
Ensures that all modules try to access their data in `_post_update_hook` in a safe manner and disable themselves if there's an error. Also adds parameters to get_preset_rules and get_on_off_gradually_info to fix issues with recent firmware updates. Cherry pick of [#1036](https://github.com/python-kasa/python-kasa/pull/1036) to patch
This commit is contained in:
@@ -14,6 +14,10 @@ class FrostProtection(SmartModule):
|
||||
REQUIRED_COMPONENT = "frost_protection"
|
||||
QUERY_GETTER_NAME = "get_frost_protection"
|
||||
|
||||
def query(self) -> dict:
|
||||
"""Query to execute during the update cycle."""
|
||||
return {}
|
||||
|
||||
@property
|
||||
def enabled(self) -> bool:
|
||||
"""Return True if frost protection is on."""
|
||||
|
||||
Reference in New Issue
Block a user