mirror of
https://github.com/esphome/aioesphomeapi.git
synced 2024-11-22 12:05:12 +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
|
||||
break
|
||||
|
||||
msg = await self._to_process.get()
|
||||
try:
|
||||
msg = await self._to_process.get()
|
||||
except RuntimeError:
|
||||
break
|
||||
|
||||
for handler in self._message_handlers[:]:
|
||||
handler(msg)
|
||||
|
Loading…
Reference in New Issue
Block a user