Fix repr for device created with no sysinfo or discovery info" (#1266)

Co-authored-by: Teemu R. <tpr@iki.fi>
This commit is contained in:
Steven B.
2024-11-18 13:14:39 +00:00
committed by GitHub
parent fd5258c28b
commit 9d46996e9b
7 changed files with 101 additions and 18 deletions

View File

@@ -757,6 +757,10 @@ class SmartDevice(Device):
# Fallback to device_type (from disco info)
type_str = self._info.get("type", self._info.get("device_type"))
if not type_str: # no update or discovery info
return self._device_type
self._device_type = self._get_device_type_from_components(
list(self._components.keys()), type_str
)