Skip to content

Commit 9bf43cc

Browse files
committed
Save updated snapshot, suggested code improvement
1 parent 3ca2c2d commit 9bf43cc

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

custom_components/plugwise/select.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def _add_entities() -> None:
9797
for device_id in coordinator.new_devices:
9898
device = coordinator.data[device_id]
9999
for description in SELECT_TYPES:
100-
if description.options_key in device and device[description.options_key]:
100+
if device.get(description.options_key):
101101
entities.append(
102102
PlugwiseSelectEntity(coordinator, device_id, description)
103103
)

tests/components/plugwise/snapshots/test_diagnostics.ambr

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@
131131
}),
132132
'446ac08dd04d4eff8ac57489757b7314': dict({
133133
'active_preset': 'no_frost',
134+
'available_schedules': list([
135+
]),
134136
'climate_mode': 'heat',
135137
'control_state': 'idle',
136138
'dev_class': 'climate',
@@ -143,6 +145,7 @@
143145
'vacation',
144146
'no_frost',
145147
]),
148+
'select_schedule': None,
146149
'sensors': dict({
147150
'temperature': 15.6,
148151
}),
@@ -635,7 +638,6 @@
635638
'warning': "Node Plug (with MAC address 000D6F000D13CB01, in room 'n.a.') has been unreachable since 23:03 2020-01-18. Please check the connection and restart the device.",
636639
}),
637640
}),
638-
'select_regulation_mode': 'heating',
639641
'sensors': dict({
640642
'outdoor_temperature': 7.81,
641643
}),

0 commit comments

Comments
 (0)