Skip to content

v1.2.15-rc1 - Bedtime/school time fix for Google's newer downtime model (#151)

Pre-release
Pre-release

Choose a tag to compare

@noiwid noiwid released this 26 Aug 18:31
· 7 commits to main since this release

Pre-release for testing the #151 fix on accounts using Google's newer downtime model. Please install only if you are affected by #151 or want to help confirm it; the stable 1.2.15 will follow once a reporter confirms.

Bedtime and school time windows on the newer downtime model (#151)

@lbschenkel's debug log showed why v1.2.14 was not enough. On these accounts:

  • bedtime slots are keyed CAMQ..., the school time slot format, while still being attached to the bedtime policy
  • policy ids are account-specific rather than the usual constants
  • school time slots may be keyed by a bare UUID

Every reader that told the two apart by key prefix therefore filed the bedtime under school time: School time in Xh for the bedtime, no bedtime window at all, "bedtime 0 schedules" in the weekly schedule, and a default 21:30-07:00 window used by enable_bedtime instead of the configured one.

Window rows are now classified by the policy id they carry (matched against the revision ids of the account) and by Google's own typed section of the appliedTimeLimits device block; the key prefix is only a fallback. This covers the sensors, the weekly bedtime and school time schedules, set_bedtime scope=weekly slot resolution and the bedtime "today" override written in the [weekday, rule_uuid] shape.

Validated by replaying the reporter's exact log shapes and a live capture of the endpoint, and deployed on a legacy-format account without any change in behaviour.

Not yet verified

Writing a bedtime "today" override (the bedtime switch) still posts the older day-code shape. If, after upgrading, toggling the bedtime switch has no effect on the device, please say so in #151.

Upgrading

A full Home Assistant restart is required, not just a reload of the integration.