mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 02:07:09 +00:00
ESPHome fix zeroconf add_listener issue (#57031)
This commit is contained in:
parent
7446e388ed
commit
da63a96273
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user