From 25229a967086ef7143bd3be3e1f72d94ec2cc942 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 26 Jul 2021 02:27:49 -0500 Subject: [PATCH] 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 --- homeassistant/components/zeroconf/__init__.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/homeassistant/components/zeroconf/__init__.py b/homeassistant/components/zeroconf/__init__.py index 907ec680cb4..a19da8df75f 100644 --- a/homeassistant/components/zeroconf/__init__.py +++ b/homeassistant/components/zeroconf/__init__.py @@ -11,12 +11,7 @@ import socket from typing import Any, TypedDict, cast import voluptuous as vol -from zeroconf import ( - InterfaceChoice, - IPVersion, - NonUniqueNameException, - ServiceStateChange, -) +from zeroconf import InterfaceChoice, IPVersion, ServiceStateChange from zeroconf.asyncio import AsyncServiceInfo from homeassistant import config_entries @@ -242,12 +237,7 @@ async def _async_register_hass_zc_service( ) _LOGGER.info("Starting Zeroconf broadcast") - try: - await aio_zc.async_register_service(info) - except NonUniqueNameException: - _LOGGER.error( - "Home Assistant instance with identical name present in the local network" - ) + await aio_zc.async_register_service(info, allow_name_change=True) class FlowDispatcher: