Skip Huawei LTE device registry setup with no identifiers or connections (#50261)
Closes https://github.com/home-assistant/core/issues/50182pull/50414/head
parent
fca56993c6
commit
3fab21ebc7
|
@ -393,6 +393,7 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
|
|||
router.subscriptions.clear()
|
||||
|
||||
# Set up device registry
|
||||
if router.device_identifiers or router.device_connections:
|
||||
device_data = {}
|
||||
sw_version = None
|
||||
if router.data.get(KEY_DEVICE_INFORMATION):
|
||||
|
@ -401,7 +402,9 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
|
|||
if device_info.get("DeviceName"):
|
||||
device_data["model"] = device_info["DeviceName"]
|
||||
if not sw_version and router.data.get(KEY_DEVICE_BASIC_INFORMATION):
|
||||
sw_version = router.data[KEY_DEVICE_BASIC_INFORMATION].get("SoftwareVersion")
|
||||
sw_version = router.data[KEY_DEVICE_BASIC_INFORMATION].get(
|
||||
"SoftwareVersion"
|
||||
)
|
||||
if sw_version:
|
||||
device_data["sw_version"] = sw_version
|
||||
device_registry = await dr.async_get_registry(hass)
|
||||
|
|
Loading…
Reference in New Issue