mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 09:17:10 +00:00
Allow zeroconf name change if there is another Home Assistant running on the local network (#53476)
* Allow zeroconf name change if there is another Home Assistant running on the local network * Remove unused try/except
This commit is contained in:
parent
3b96085716
commit
25229a9670
@ -11,12 +11,7 @@ import socket
|
|||||||
from typing import Any, TypedDict, cast
|
from typing import Any, TypedDict, cast
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
from zeroconf import (
|
from zeroconf import InterfaceChoice, IPVersion, ServiceStateChange
|
||||||
InterfaceChoice,
|
|
||||||
IPVersion,
|
|
||||||
NonUniqueNameException,
|
|
||||||
ServiceStateChange,
|
|
||||||
)
|
|
||||||
from zeroconf.asyncio import AsyncServiceInfo
|
from zeroconf.asyncio import AsyncServiceInfo
|
||||||
|
|
||||||
from homeassistant import config_entries
|
from homeassistant import config_entries
|
||||||
@ -242,12 +237,7 @@ async def _async_register_hass_zc_service(
|
|||||||
)
|
)
|
||||||
|
|
||||||
_LOGGER.info("Starting Zeroconf broadcast")
|
_LOGGER.info("Starting Zeroconf broadcast")
|
||||||
try:
|
await aio_zc.async_register_service(info, allow_name_change=True)
|
||||||
await aio_zc.async_register_service(info)
|
|
||||||
except NonUniqueNameException:
|
|
||||||
_LOGGER.error(
|
|
||||||
"Home Assistant instance with identical name present in the local network"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class FlowDispatcher:
|
class FlowDispatcher:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user