forked from home-assistant/core
ESPHome fix zeroconf add_listener issue (#57031)
This commit is contained in:
committed by
Paulus Schoutsen
parent
36bac936d1
commit
b106dab916
@@ -503,16 +503,14 @@ class ReconnectLogic(RecordUpdateListener):
|
|||||||
"""
|
"""
|
||||||
async with self._zc_lock:
|
async with self._zc_lock:
|
||||||
if not self._zc_listening:
|
if not self._zc_listening:
|
||||||
await self._hass.async_add_executor_job(
|
self._zc.async_add_listener(self, None)
|
||||||
self._zc.add_listener, self, None
|
|
||||||
)
|
|
||||||
self._zc_listening = True
|
self._zc_listening = True
|
||||||
|
|
||||||
async def _stop_zc_listen(self) -> None:
|
async def _stop_zc_listen(self) -> None:
|
||||||
"""Stop listening for zeroconf updates."""
|
"""Stop listening for zeroconf updates."""
|
||||||
async with self._zc_lock:
|
async with self._zc_lock:
|
||||||
if self._zc_listening:
|
if self._zc_listening:
|
||||||
await self._hass.async_add_executor_job(self._zc.remove_listener, self)
|
self._zc.async_remove_listener(self)
|
||||||
self._zc_listening = False
|
self._zc_listening = False
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
|
Reference in New Issue
Block a user