Uh oh!
There was an error while loading. Please reload this page.
feat: add holiday mode support (get/set/cancel) - #149
Conversation
Adds get_holiday_mode/set_holiday_mode/cancel_holiday_mode to the async and sync API layers and a HiveHub wrapper accepting datetime start/end. Payload shape (GET/POST/DELETE on /holiday-mode, epoch-ms start/end + temperature) was confirmed via a HAR capture of Hive's own website, since this endpoint was previously unimplemented. Includes the diagnostic scripts used to reverse-engineer it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Exercises HiveHub.get_holiday_mode/set_holiday_mode/cancel_holiday_mode against a real Hive account: schedules a 7-day window starting in an hour (verified via GET readback, then cancelled before it can go active), and a second window starting an hour in the past to check whether the backend rejects it (it doesn't -- only the app's UI enforces that, not the API). Prints both UTC and local time so results are directly comparable against the Hive app/website. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Not intended to be committed to the repo -- kept locally only. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Not intended to be committed to the repo -- kept locally only. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@## dev #149 +/- ##
=======================================
Coverage 99.96% 99.96% =======================================
Files 30 30 Lines 2508 2563 +55 Branches 292 296 +4 =======================================
+ Hits 2507 2562 +55
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
KJonline
commented
Jul 12, 2026
@nsleigh please can you fix the linting errors please |
Two dict literals in test_hub.py exceeded ruff format's line-wrap threshold, failing the Lint CI check (ruff check itself was clean, since E501 is ignored, but ruff format still wants the wrap).
nsleigh
commented
Jul 12, 2026
nsleigh
commented
Jul 12, 2026
KJonline
commented
Jul 12, 2026
@nsleigh there is just the 2 pylint ones `
************* Module tests.unit.test_hive_api |
- test_hive_api.py: drop unused url_arg from tuple-unpack, index the two needed values individually (matches existing pattern elsewhere in this file) — fixes W0612 unused-variable - test_hive_async_api.py: remove redundant local 'import json', module already imports it at the top — fixes W0404 reimported
nsleigh
commented
Jul 13, 2026
I am hoping they are ok now - relying too much on AI! |
nsleigh
commented
Jul 14, 2026
@KJonline all fixed on my side. The new failure is due to the workflow not working on a branch. |
Summary
get_holiday_mode()/set_holiday_mode()/cancel_holiday_mode()to both the async (HiveApiAsync) and sync (HiveApi) API layers, plus aHiveHubconvenience wrapper (set_holiday_modetakesdatetimestart/end and converts to epoch-ms internally)./holiday-modeendpoint was previously unimplemented in this library (only the URL constant existed, going back to 2021) — the request/response shape (GET/POST/DELETE, epoch-millisecondstart/end,temperature) was confirmed from a HAR capture of Hive's own website, then verified end-to-end against a real account.HiveApi.request()to supportDELETE(previously onlyGET/POST), needed forcancel_holiday_mode().MALFORMED_REQUEST). Root cause turned out to be thatautoBoostis not a client-writable field — it appears to be a server-side side effect of Holiday Mode, which is why this PR adds real Holiday Mode support instead of patching that field directly.starttime (confirmed live) — that's only enforced client-side by the Hive app/website UI, not the API. Leftset_holiday_modeas a thin wrapper matching the real API contract rather than adding client-side validation.Test plan
get_holiday_mode/set_holiday_mode/cancel_holiday_modein bothtests/unit/test_hive_async_api.pyandtests/unit/test_hive_api.pyHiveHubwrapper intests/module/test_hub.pyGET /holiday-modereadback that start/end matched, then cancelled and confirmed cancellation; also confirmed a past-start-time request is accepted by the API (not rejected)🤖 Generated with Claude Code