Skip to content

Add convenience wrappers for todo, calendar, and automation control #441

@jessica-claude

Description

@jessica-claude

Description

Several HA operations are technically possible via hassette's existing call_service() and REST methods, but lack typed convenience wrappers. Adding thin typed APIs for these would improve DX for common automation patterns.

Todo CRUD

Currently requires raw call_service('todo', 'add_item', ...). A typed wrapper would make task-management automations cleaner.

Use cases:

  • Add "replace air filter" to a maintenance list when a counter threshold is hit
  • Create a grocery item when a pantry sensor trips
  • Mark items complete when an automation confirms the task was done

Services to wrap: todo.add_item, todo.update_item, todo.remove_item, todo.get_items
WS-only: todo/item/list (for richer filtering), todo/item/move (reordering)

Calendar Event Read

Hassette already has get_calendar_events() via REST. This may just need better discoverability or typed response models if not already covered.

Use cases:

  • Don't run the vacuum if there's a meeting on the calendar
  • Pre-heat the house 30 min before an "arrive home" calendar event
  • Schedule-aware lighting scenes

Automation Enable/Disable

Currently requires call_service('automation', 'turn_on'/'turn_off', ...). A typed method makes meta-automation patterns more readable.

Use cases:

  • Disable motion-light automation when movie mode is on
  • Enable security automations when everyone leaves
  • Seasonal automation toggling (e.g., holiday lighting schedules)

Services to wrap: automation.turn_on, automation.turn_off, automation.toggle, automation.trigger

Acceptance Criteria

  • Typed methods for todo CRUD (add_todo_item, update_todo_item, remove_todo_item, get_todo_items)
  • Typed response models for todo items
  • Typed methods for automation enable/disable (enable_automation, disable_automation, toggle_automation)
  • Verify calendar event API coverage and add typed models if missing
  • Tests for all new methods

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:apiHA REST/WebSocket APIenhancementNew feature or requestsize:mediumModerate effort, a few hours

    Projects

    Status

    Refinement

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions