Skip to content

Commit ad83784

Browse files
committed
Remove blocking call in emulation mode
1 parent 199f84c commit ad83784

File tree

1 file changed

+4
-1
lines changed
  • custom_components/smartthinq_sensors/wideq

1 file changed

+4
-1
lines changed

custom_components/smartthinq_sensors/wideq/device.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,10 @@ async def _device_poll(
776776
return self._model_info.decode_snapshot(snapshot, snapshot_key)
777777

778778
# ThinQ V1 - Monitor data must be polled """
779-
if not (data := self._load_emul_v1_payload()):
779+
data = None
780+
if self._client.emulation:
781+
data = await asyncio.to_thread(self._load_emul_v1_payload)
782+
if not data:
780783
data = await self._mon.refresh()
781784
if not data:
782785
return None

0 commit comments

Comments
 (0)