Fix VacationHold.enabled reading the wrong JSON key - #170
Conversation
timmo001
left a comment
There was a problem hiding this comment.
The API docs use lowercase vacationHold.enabled 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 silently return False.
Resideo's docs specify lowercase enabled, but a live captured payload from a T9-T10 account shows Enabled (capital E). Check the documented key first and fall back to the observed one so neither response shape reads back False. Addresses review feedback on timmo001#170. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Good catch — updated to support both keys, same approach as the fix on #166: @Property Also added test_vacation_hold_enabled_key_variants covering both casings plus the missing-key default, and updated the existing assertions accordingly — all green. |
Resideo's device response returns vacationHold.Enabled (capital E),
not vacationHold.enabled. Confirmed against a live captured payload
from a T9-T10 account: {'vacationHold': {'Enabled': False}}.
Because the property silently defaulted to False on the missing key,
an active vacation hold would always report as off with no error -
same failure mode as the other field-name mismatches already fixed
in this library.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Resideo's docs specify lowercase enabled, but a live captured payload from a T9-T10 account shows Enabled (capital E). Check the documented key first and fall back to the observed one so neither response shape reads back False. Addresses review feedback on timmo001#170. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2bb1b9b to
16fda6b
Compare
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>
Because the property silently defaulted to
Falseon the missing key, an activevacation hold would always report as off — no error, no exception, just wrong data.
Same failure mode as the other field-name mismatches already fixed in this library
(
#165).Changes
aiolyric/objects/device.py:VacationHold.enablednow readsEnabled.tests/__init__.py,tests/objects/test_device.py,tests/objects/test_location.py:fixtures and assertions updated to match.
pytest tests/objects/passes (3/3).Context
Found via a Copilot review comment on a companion
home-assistant/corePR(
Ocala Thermostatroom-sensor work), then confirmed against a debug log alreadycaptured from a live account rather than guessed.