mirror of
https://github.com/XiaoMi/ha_xiaomi_home.git
synced 2025-12-13 17:50:30 +08:00
fix: stop MQTT internal loop immediately when main loop is closed (#1484)
This commit is contained in:
parent
c04fa542a3
commit
1ec325c9c7
@ -589,6 +589,13 @@ class _MipsClient(ABC):
|
|||||||
|
|
||||||
def __mqtt_loop_handler(self) -> None:
|
def __mqtt_loop_handler(self) -> None:
|
||||||
try:
|
try:
|
||||||
|
# If the main loop is closed, stop the internal loop immediately
|
||||||
|
if self.main_loop.is_closed():
|
||||||
|
self.log_debug(
|
||||||
|
'The main loop is closed, stop the internal loop.')
|
||||||
|
if not self._internal_loop.is_closed():
|
||||||
|
self._internal_loop.stop()
|
||||||
|
return
|
||||||
if self._mqtt:
|
if self._mqtt:
|
||||||
self._mqtt.loop_read()
|
self._mqtt.loop_read()
|
||||||
if self._mqtt:
|
if self._mqtt:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user