Add child devices from hubs to generated list of supported devices (#898)

Updates generate_supported hook to include child devices of hubs in the list of supported devices.
This commit is contained in:
Steven B
2024-05-07 07:48:47 +01:00
committed by GitHub
parent c5d65b624b
commit f063c83378
4 changed files with 53 additions and 12 deletions

View File

@@ -639,6 +639,10 @@ class SmartDevice(Bulb, Fan, Device):
return DeviceType.Bulb
if "SWITCH" in device_type:
return DeviceType.WallSwitch
if "SENSOR" in device_type:
return DeviceType.Sensor
if "ENERGY" in device_type:
return DeviceType.Thermostat
_LOGGER.warning("Unknown device type, falling back to plug")
return DeviceType.Plug