mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 03:37:07 +00:00
Fix creating smappee sensors when remote is not active (#30270)
This commit is contained in:
parent
a91b005822
commit
85624e8031
@ -97,19 +97,18 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
|||||||
)
|
)
|
||||||
|
|
||||||
if smappee.is_local_active:
|
if smappee.is_local_active:
|
||||||
for location_id in smappee.locations.keys():
|
if smappee.is_remote_active:
|
||||||
|
location_keys = smappee.locations.keys()
|
||||||
|
else:
|
||||||
|
location_keys = [None]
|
||||||
|
for location_id in location_keys:
|
||||||
for sensor in SENSOR_TYPES:
|
for sensor in SENSOR_TYPES:
|
||||||
if "local" in SENSOR_TYPES[sensor]:
|
if "local" in SENSOR_TYPES[sensor]:
|
||||||
if smappee.is_remote_active:
|
|
||||||
dev.append(
|
dev.append(
|
||||||
SmappeeSensor(
|
SmappeeSensor(
|
||||||
smappee, location_id, sensor, SENSOR_TYPES[sensor]
|
smappee, location_id, sensor, SENSOR_TYPES[sensor]
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
else:
|
|
||||||
dev.append(
|
|
||||||
SmappeeSensor(smappee, None, sensor, SENSOR_TYPES[sensor])
|
|
||||||
)
|
|
||||||
|
|
||||||
add_entities(dev, True)
|
add_entities(dev, True)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user