1
0
mirror of https://github.com/home-assistant/core.git synced 2026-07-04 05:05:38 +01:00
Files
core/homeassistant/components/zeroconf/models.py
T
2026-06-22 20:51:13 +02:00

27 lines
592 B
Python

"""Models for Zeroconf."""
from typing import override
from zeroconf import Zeroconf
from zeroconf.asyncio import AsyncZeroconf
class HaZeroconf(Zeroconf):
"""Zeroconf that cannot be closed."""
@override
def close(self) -> None:
"""Fake method to avoid integrations closing it."""
ha_close = Zeroconf.close
class HaAsyncZeroconf(AsyncZeroconf):
"""Home Assistant version of AsyncZeroconf."""
@override
async def async_close(self) -> None:
"""Fake method to avoid integrations closing it."""
ha_async_close = AsyncZeroconf.async_close