diff --git a/homeassistant/components/kodi/config_flow.py b/homeassistant/components/kodi/config_flow.py index 6e7ff6bb2a4..461df3b09e6 100644 --- a/homeassistant/components/kodi/config_flow.py +++ b/homeassistant/components/kodi/config_flow.py @@ -104,13 +104,13 @@ class KodiConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): self, discovery_info: zeroconf.ZeroconfServiceInfo ) -> FlowResult: """Handle zeroconf discovery.""" - self._host = discovery_info[zeroconf.ATTR_HOST] - self._port = int(discovery_info[zeroconf.ATTR_PORT]) - self._name = discovery_info[zeroconf.ATTR_HOSTNAME][: -len(".local.")] - if not (uuid := discovery_info[zeroconf.ATTR_PROPERTIES].get("uuid")): + self._host = discovery_info.host + self._port = int(discovery_info.port) + self._name = discovery_info.hostname[: -len(".local.")] + if not (uuid := discovery_info.properties.get("uuid")): return self.async_abort(reason="no_uuid") - self._discovery_name = discovery_info[zeroconf.ATTR_NAME] + self._discovery_name = discovery_info.name await self.async_set_unique_id(uuid) self._abort_if_unique_id_configured(