Skip to content

Backport holiday mode (#149) to 1.0.x - #194

Open
nsleigh wants to merge 1 commit into
Pyhass:masterfrom
nsleigh:backport/holiday-mode-1.0.x
Open

nsleigh wants to merge 1 commit into
Pyhass:masterfrom
nsleigh:backport/holiday-mode-1.0.x

Conversation

@nsleigh

@nsleigh nsleigh commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Backport of #149 (holiday mode) from dev to the 1.0.x line, as discussed on Pyhass/Hive-Custom-Component#222. With this in a 1.0.x release, the custom component can ship holiday mode on a stable pin instead of the 2.0 beta.

Change

  • HiveApiAsync and HiveApi: get_holiday_mode, set_holiday_mode and cancel_holiday_mode. These send GET, POST and DELETE to the existing holiday_mode URL (/holiday-mode), with start/end as epoch milliseconds plus temperature. They follow the error and file-mode handling of the other calls in each file.
  • HiveApi.request() now supports DELETE, which cancel needs.
  • HiveHub: get_holiday_mode(), set_holiday_mode(start, end, temperature) (datetimes) and cancel_holiday_mode(), returning the parsed data / True on HTTP 200. The method names and behaviour match dev, so merging this back into dev should only need the conflicts resolved in favour of dev.

The sync pyhiveapi package is generated by unasync as usual. I checked that its HiveHub methods come out as plain functions.

Testing

  • Unit tests covering the hub and both API layers (8 tests) pass locally. They aren't in this PR because tests/ is gitignored on master; I can add them if you'd like.
  • black, flake8, pylint, codespell and bandit are clean on the changed files.
  • Live: I've been running this bundled into the custom component (the reworked #222) against my own Hive account. I scheduled holiday mode, watched it go scheduled → active, cancelled it, and let another window end on its own across an HA restart. The Hive app matched each time.

🤖 Generated with Claude Code

Backports Pyhass#149 from dev to the 1.0.x line so the Hive custom component can
ship holiday mode on a stable release (HCC #222).

- HiveApiAsync / HiveApi: get_holiday_mode, set_holiday_mode and
  cancel_holiday_mode (GET/POST/DELETE on /holiday-mode, epoch-ms start/end
  plus temperature). The sync API's request() now supports DELETE.
- HiveHub: get_holiday_mode/set_holiday_mode/cancel_holiday_mode wrappers
  taking datetime start/end, matching dev's method names so the merge back
  into dev is straightforward.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant