mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-10-12 02:18:02 +00:00
Handle module errors more robustly and add query params to light preset and transition (#1036)
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. [#1033](https://github.com/python-kasa/python-kasa/issues/1033)
This commit is contained in:
@@ -140,7 +140,7 @@ class LightPreset(SmartModule, LightPresetInterface):
|
||||
"""Query to execute during the update cycle."""
|
||||
if self._state_in_sysinfo: # Child lights can have states in the child info
|
||||
return {}
|
||||
return {self.QUERY_GETTER_NAME: None}
|
||||
return {self.QUERY_GETTER_NAME: {"start_index": 0}}
|
||||
|
||||
async def _check_supported(self):
|
||||
"""Additional check to see if the module is supported by the device.
|
||||
|
Reference in New Issue
Block a user