Improve lists in integrations [G-H] (#113168)
This commit is contained in:
parent
d4ae4a9cd0
commit
761933acfe
44 changed files with 392 additions and 433 deletions
|
@ -88,19 +88,18 @@ async def async_setup_entry(
|
|||
entities: list[PowerViewSensor] = []
|
||||
for shade in pv_entry.shade_data.values():
|
||||
room_name = getattr(pv_entry.room_data.get(shade.room_id), ATTR_NAME, "")
|
||||
for description in SENSORS:
|
||||
if description.create_entity_fn(shade):
|
||||
entities.append(
|
||||
PowerViewSensor(
|
||||
pv_entry.coordinator,
|
||||
pv_entry.device_info,
|
||||
room_name,
|
||||
shade,
|
||||
shade.name,
|
||||
description,
|
||||
)
|
||||
)
|
||||
|
||||
entities.extend(
|
||||
PowerViewSensor(
|
||||
pv_entry.coordinator,
|
||||
pv_entry.device_info,
|
||||
room_name,
|
||||
shade,
|
||||
shade.name,
|
||||
description,
|
||||
)
|
||||
for description in SENSORS
|
||||
if description.create_entity_fn(shade)
|
||||
)
|
||||
async_add_entities(entities)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue