Skip to content

feat(timer): add on_finished/on_cancelled listeners and time_remaining property#40

Merged
Faerkeren merged 1 commit into
mainfrom
feat/timer-enhancements
Apr 27, 2026
Merged

feat(timer): add on_finished/on_cancelled listeners and time_remaining property#40
Faerkeren merged 1 commit into
mainfrom
feat/timer-enhancements

Conversation

@Faerkeren

Copy link
Copy Markdown
Contributor

Summary

  • Add on_finished and on_cancelled listener decorators that distinguish natural timer expiry from explicit cancellation, using HA dedicated timer.finished and timer.cancelled event types
  • Add time_remaining computed property that returns live seconds remaining -- calculated from finishes_at when active, parsed from remaining attribute when paused
  • Subscribe to timer.finished and timer.cancelled events at the client level and route to Timer entities
  • 10 new tests covering all new functionality (event listeners, computed property edge cases)
  • All 156 tests pass, 95.22% coverage, lint/mypy clean

…g property

Distinguish natural timer expiry from cancellation using HA's dedicated
timer.finished and timer.cancelled event types. Add computed time_remaining
property that calculates live seconds from finishes_at (active) or parses
the remaining attribute (paused).
@Faerkeren Faerkeren merged commit 674c650 into main Apr 27, 2026
12 checks passed
@Faerkeren Faerkeren deleted the feat/timer-enhancements branch April 27, 2026 00:23
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