Skip to content

feat: add Timer domain for Home Assistant timer entities#27

Merged
Faerkeren merged 1 commit into
mainfrom
feat/timer-domain
Apr 26, 2026
Merged

feat: add Timer domain for Home Assistant timer entities#27
Faerkeren merged 1 commit into
mainfrom
feat/timer-domain

Conversation

@Faerkeren

Copy link
Copy Markdown
Contributor

Summary

  • Add Timer domain class (src/haclient/domains/timer.py) supporting HA timer entities (timer.<name>)
  • Properties: is_active, is_paused, is_idle, duration, remaining, finishes_at
  • Actions: start(duration=), pause(), cancel(), finish(), change(duration=)
  • Listener decorators: on_start(), on_pause(), on_idle()
  • Register timer() accessor on HAClient

Usage

async with HAClient("http://ha:8123", token="...") as ha:
    t = ha.timer("my_timer")
    await t.start(duration="00:05:00")
    
    @t.on_idle
    def finished(old, new):
        print("Timer done!")

All 131 tests pass. Coverage: 95.07%.

Add Timer domain class with state properties (is_active, is_paused,
is_idle, duration, remaining, finishes_at), action methods (start,
pause, cancel, finish, change), and listener decorators (on_start,
on_pause, on_idle).
@Faerkeren Faerkeren merged commit 3f9084b into main Apr 26, 2026
12 checks passed
@Faerkeren Faerkeren deleted the feat/timer-domain branch April 26, 2026 00:44
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