mirror of
https://github.com/esphome/aioesphomeapi.git
synced 2024-11-26 12:45:26 +01:00
Catch error when task is stopped (#306)
This commit is contained in:
parent
949563c6f0
commit
356e4fbd8f
@ -531,7 +531,10 @@ class APIConnection:
|
|||||||
# Socket closed but task isn't cancelled yet
|
# Socket closed but task isn't cancelled yet
|
||||||
break
|
break
|
||||||
|
|
||||||
msg = await self._to_process.get()
|
try:
|
||||||
|
msg = await self._to_process.get()
|
||||||
|
except RuntimeError:
|
||||||
|
break
|
||||||
|
|
||||||
for handler in self._message_handlers[:]:
|
for handler in self._message_handlers[:]:
|
||||||
handler(msg)
|
handler(msg)
|
||||||
|
Loading…
Reference in New Issue
Block a user