Discover more power and energy sensors in fibaro integration (#98253)

This commit is contained in:
rappenze 2023-09-01 10:48:08 +02:00 committed by GitHub
parent 65246b99ec
commit 680775c3e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -113,7 +113,15 @@ async def async_setup_entry(
# main sensors are created even if the entity type is not known # main sensors are created even if the entity type is not known
entities.append(FibaroSensor(device, entity_description)) entities.append(FibaroSensor(device, entity_description))
for platform in (Platform.COVER, Platform.LIGHT, Platform.SENSOR, Platform.SWITCH): for platform in (
Platform.BINARY_SENSOR,
Platform.CLIMATE,
Platform.COVER,
Platform.LIGHT,
Platform.LOCK,
Platform.SENSOR,
Platform.SWITCH,
):
for device in hass.data[DOMAIN][entry.entry_id][FIBARO_DEVICES][platform]: for device in hass.data[DOMAIN][entry.entry_id][FIBARO_DEVICES][platform]:
for entity_description in ADDITIONAL_SENSOR_TYPES: for entity_description in ADDITIONAL_SENSOR_TYPES:
if entity_description.key in device.properties: if entity_description.key in device.properties: