Skip to content

Fix ScheduleType.schedule_sub_type reading the wrong JSON key - #166

Merged
timmo001 merged 2 commits into
timmo001:masterfrom
clutch2sft:fix/device-schedule-subtype
Aug 10, 2026
Merged

Fix ScheduleType.schedule_sub_type reading the wrong JSON key#166
timmo001 merged 2 commits into
timmo001:masterfrom
clutch2sft:fix/device-schedule-subtype

Conversation

@clutch2sft

Copy link
Copy Markdown
Contributor

Resideo's API returns "scheduleSubtype" (lowercase t) for both device and location responses, not "scheduleSubType". Found while auditing device.py for the same class of field-name mismatch fixed in the priority endpoint (#165). Not currently consumed anywhere in Home Assistant's lyric integration, so this was never visibly broken, but the fixtures encoded the same wrong key the code was reading, so the existing tests passed without ever catching it against a real response.

Resideo's API returns "scheduleSubtype" (lowercase t) for both device
and location responses, not "scheduleSubType". Found while auditing
device.py for the same class of field-name mismatch fixed in the
priority endpoint (timmo001#165). Not currently consumed anywhere in
Home Assistant's lyric integration, so this was never visibly broken,
but the fixtures encoded the same wrong key the code was reading, so
the existing tests passed without ever catching it against a real
response.

@timmo001 timmo001 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The API docs use scheduleSubType here: https://developer.honeywellhome.com/lyric/apis/get/devices/thermostats/%7BdeviceId%7D-0. Can we support both keys? Replacing it outright means responses matching the documented schema will return None.

Resideo's docs specify scheduleSubType, but the live API sends
scheduleSubtype (lowercase t). Check the documented key first and
fall back to the observed one so neither response shape reads back
None.

Addresses review feedback on timmo001#166.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@timmo001
timmo001 merged commit 5731e6b into timmo001:master Aug 10, 2026
5 of 10 checks passed
clutch2sft added a commit to clutch2sft/aiolyric that referenced this pull request Aug 10, 2026
Resideo's docs specify lowercase day/period, but a live capture from
a T9-T10 account shows the API actually sending PascalCase Day/Period
(same casing mismatch as vacationHold.enabled/Enabled, currently under
review on timmo001#170). Check the documented key first and fall back to the
observed one so neither response shape reads back None.

Found while auditing device.py for the class of field-name/casing
mismatch raised in review on timmo001#166 and timmo001#170.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants