mirror of
https://github.com/home-assistant/core.git
synced 2025-08-16 02:51:40 +02:00
Refactor with extend
This commit is contained in:
@@ -64,12 +64,12 @@ async def async_setup_entry(
|
|||||||
|
|
||||||
api = config_entry.runtime_data
|
api = config_entry.runtime_data
|
||||||
|
|
||||||
for description in GARAGE_SENSOR_DESCRIPTIONS:
|
sensors: list[ZimiSensor] = []
|
||||||
sensors: list[ZimiSensor] = [
|
|
||||||
ZimiSensor(device, description, api) for device in api.sensors
|
|
||||||
]
|
|
||||||
|
|
||||||
async_add_entities(sensors)
|
for description in GARAGE_SENSOR_DESCRIPTIONS:
|
||||||
|
sensors.extend([ZimiSensor(device, description, api) for device in api.sensors])
|
||||||
|
|
||||||
|
async_add_entities(sensors)
|
||||||
|
|
||||||
|
|
||||||
class ZimiSensor(ZimiEntity, SensorEntity):
|
class ZimiSensor(ZimiEntity, SensorEntity):
|
||||||
|
Reference in New Issue
Block a user