mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-12-01 21:58:17 +00:00
Make Light and Fan a common module interface (#911)
This commit is contained in:
@@ -307,6 +307,9 @@ class IotDevice(Device):
|
||||
self._last_update = response
|
||||
self._set_sys_info(response["system"]["get_sysinfo"])
|
||||
|
||||
if not self._modules:
|
||||
await self._initialize_modules()
|
||||
|
||||
await self._modular_update(req)
|
||||
|
||||
if not self._features:
|
||||
@@ -314,6 +317,9 @@ class IotDevice(Device):
|
||||
|
||||
self._set_sys_info(self._last_update["system"]["get_sysinfo"])
|
||||
|
||||
async def _initialize_modules(self):
|
||||
"""Initialize modules not added in init."""
|
||||
|
||||
async def _initialize_features(self):
|
||||
self._add_feature(
|
||||
Feature(
|
||||
|
||||
Reference in New Issue
Block a user