From e996142592a1c13ab5bdb4c7bd56df6effd3756c Mon Sep 17 00:00:00 2001 From: Robert Svensson Date: Mon, 11 Apr 2022 09:13:25 +0200 Subject: [PATCH] Improve typing of deCONZ gateway (#69459) * Improve typing of deCONZ gateway * Fix review comments --- homeassistant/components/deconz/gateway.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/deconz/gateway.py b/homeassistant/components/deconz/gateway.py index aba5c4b4a6d..041dc2cdaf2 100644 --- a/homeassistant/components/deconz/gateway.py +++ b/homeassistant/components/deconz/gateway.py @@ -158,6 +158,9 @@ class DeconzGateway: async def async_update_device_registry(self) -> None: """Update device registry.""" + if self.api.config.mac is None: + return + device_registry = dr.async_get(self.hass) # Host device @@ -241,7 +244,7 @@ class DeconzGateway: async def async_reset(self) -> bool: """Reset this gateway to default state.""" - self.api.async_connection_status_callback = None + self.api.connection_status_callback = None self.api.close() await self.hass.config_entries.async_unload_platforms(