mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-09 20:24:02 +00:00
Support smart child modules queries (#967)
Required for the P300 firmware update with `auto_off` module on child devices. Will query child modules for parent devices that are not hubs. Coverage will be fixed when the P300 fixture is added https://github.com/python-kasa/python-kasa/pull/915
This commit is contained in:
@@ -99,3 +99,11 @@ class AutoOff(SmartModule):
|
||||
sysinfo = self._device.sys_info
|
||||
|
||||
return self._device.time + timedelta(seconds=sysinfo["auto_off_remain_time"])
|
||||
|
||||
async def _check_supported(self):
|
||||
"""Additional check to see if the module is supported by the device.
|
||||
|
||||
Parent devices that report components of children such as P300 will not have
|
||||
the auto_off_status is sysinfo.
|
||||
"""
|
||||
return "auto_off_status" in self._device.sys_info
|
||||
|
Reference in New Issue
Block a user