Skip to content

Commit 444e9c9

Browse files
committed
Handle the case that a schedule can have no name, fixed #228
* custom_components/daikin_onecta/select.py: * tests/fixtures/schedule.json: * tests/snapshots/test_init.ambr: * tests/test_init.py:
1 parent e9df0e4 commit 444e9c9

File tree

4 files changed

+1300
-504
lines changed

4 files changed

+1300
-504
lines changed

custom_components/daikin_onecta/select.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def get_options(self):
142142
if scheduledict is not None:
143143
currentMode = scheduledict["value"]["currentMode"]["value"]
144144
for scheduleName in scheduledict["value"]["modes"][currentMode]["currentSchedule"]["values"]:
145-
readableName = scheduledict["value"]["modes"][currentMode]["schedules"][scheduleName]["name"]["value"]
145+
readableName = scheduledict["value"]["modes"][currentMode]["schedules"][scheduleName]["name"].get("value")
146146
# The schedule can maybe have an empty name set, use at that moment the internal ID
147147
if not readableName:
148148
readableName = scheduleName

0 commit comments

Comments
 (0)