Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add timers for English #2179

Merged
merged 3 commits into from
May 20, 2024
Merged

Add timers for English #2179

merged 3 commits into from
May 20, 2024

Conversation

synesthesiam
Copy link
Contributor

First pass at English support for Assist timers (see home-assistant/core#117199)

This adds support for the new intents:

  • HassStartTimer - start a new timer
  • HassCancelTimer - cancel a timer by name, area, or start time
  • HassTimerStatus - report status of timer(s)
  • HassIncreaseTimer - add time to a timer
  • HassDecreaseTimer - remove time from a timer
  • HassPauseTimer - pause a running timer
  • HassUnpauseTimer - resume a paused timer

Additionally, a new timers section is present in _fixtures.yaml with information about the timers used in the tests:

timers:
  - start_hours: 1
    total_seconds_left: 100
    rounded_hours_left: 0
    rounded_minutes_left: 1
    rounded_seconds_left: 40
  - name: pizza
    start_minutes: 30
    total_seconds_left: 1505
    rounded_hours_left: 0
    rounded_minutes_left: 25
    rounded_seconds_left: 0
  - area: kitchen
    start_minutes: 5
    total_seconds_left: 190
    rounded_hours_left: 0
    rounded_minutes_left: 3
    rounded_seconds_left: 0

name: HassDecreaseTimer
slots:
minutes: 5
name: "pizza "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this not match the trailing space?

Suggested change
name: "pizza "
name: "pizza"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The wildcard consumes the trailing space in hassil. This will be fixed in a larger PR later that will touch on multiple languages.

@synesthesiam synesthesiam merged commit 1b21240 into main May 20, 2024
2 checks passed
@synesthesiam synesthesiam deleted the synesthesiam-20240515-timers branch May 20, 2024 19:33
@tetele
Copy link
Contributor

tetele commented May 21, 2024

I've noticed a naming inconsistency between these new intents and old ones such as HassClimateGetTemperature , HassMediaPause, HassVacuumStart or HassShoppingListAddItem.

The old ones have the object before the action in their name. The new ones have the object (Timer) at the end. It's probably not the end of the world, but it is inconsistent.

@tetele tetele mentioned this pull request May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants