Skip to content

Commit

Permalink
Remove blocking call in emulation mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ollo69 committed Jan 4, 2025
1 parent 199f84c commit ad83784
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion custom_components/smartthinq_sensors/wideq/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,10 @@ async def _device_poll(
return self._model_info.decode_snapshot(snapshot, snapshot_key)

# ThinQ V1 - Monitor data must be polled """
if not (data := self._load_emul_v1_payload()):
data = None
if self._client.emulation:
data = await asyncio.to_thread(self._load_emul_v1_payload)
if not data:
data = await self._mon.refresh()
if not data:
return None
Expand Down

0 comments on commit ad83784

Please sign in to comment.