Improve typing of deCONZ gateway (#69459)

* Improve typing of deCONZ gateway
* Fix review comments
This commit is contained in:
Robert Svensson 2022-04-11 09:13:25 +02:00 committed by GitHub
parent 800bf926aa
commit e996142592
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -158,6 +158,9 @@ class DeconzGateway:
async def async_update_device_registry(self) -> None: async def async_update_device_registry(self) -> None:
"""Update device registry.""" """Update device registry."""
if self.api.config.mac is None:
return
device_registry = dr.async_get(self.hass) device_registry = dr.async_get(self.hass)
# Host device # Host device
@ -241,7 +244,7 @@ class DeconzGateway:
async def async_reset(self) -> bool: async def async_reset(self) -> bool:
"""Reset this gateway to default state.""" """Reset this gateway to default state."""
self.api.async_connection_status_callback = None self.api.connection_status_callback = None
self.api.close() self.api.close()
await self.hass.config_entries.async_unload_platforms( await self.hass.config_entries.async_unload_platforms(