Fix modularize with strips (#326)

* Fix test_deprecated_type stalling

* Fix strips with modularize

* Fix test_deprecated_type stalling (#325)
This commit is contained in:
J. Nick Koston
2022-04-05 06:16:36 -10:00
committed by Teemu R
parent f0d66e4195
commit 1e4df7ec1b
4 changed files with 24 additions and 22 deletions

View File

@@ -314,6 +314,11 @@ class SmartDevice:
self._last_update = await self.protocol.query(req)
self._sys_info = self._last_update["system"]["get_sysinfo"]
await self._modular_update(req)
self._sys_info = self._last_update["system"]["get_sysinfo"]
async def _modular_update(self, req: dict) -> None:
"""Execute an update query."""
if self.has_emeter:
_LOGGER.debug(
"The device has emeter, querying its information along sysinfo"
@@ -326,10 +331,9 @@ class SmartDevice:
continue
q = module.query()
_LOGGER.debug("Adding query for %s: %s", module, q)
req = merge(req, module.query())
req = merge(req, q)
self._last_update = await self.protocol.query(req)
self._sys_info = self._last_update["system"]["get_sysinfo"]
def update_from_discover_info(self, info):
"""Update state from info from the discover call."""