-
Notifications
You must be signed in to change notification settings - Fork 490
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
115 changed files
with
2,838 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
hassil==1.7.0 | ||
hassil==1.7.1 | ||
PyYAML==6.0.1 | ||
voluptuous==0.13.1 | ||
regex==2024.4.16 | ||
jinja2==3.1.3 | ||
regex==2024.5.15 | ||
jinja2==3.1.4 | ||
|
||
black==24.4.0 | ||
black==24.4.2 | ||
flake8==7.0.0 | ||
isort==5.13.2 | ||
mypy==1.10.0 | ||
pylint==3.1.0 | ||
pytest==8.2.0 | ||
pylint==3.2.2 | ||
pytest==8.2.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
language: bg | ||
responses: | ||
intents: | ||
HassListAddItem: | ||
item_added: "Добавих {{ slots.item }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
language: en | ||
responses: | ||
intents: | ||
HassCancelTimer: | ||
default: "Timer cancelled" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
language: en | ||
responses: | ||
intents: | ||
HassDecreaseTimer: | ||
default: "Timer updated" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
language: en | ||
responses: | ||
intents: | ||
HassIncreaseTimer: | ||
default: "Timer updated" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ language: en | |
responses: | ||
intents: | ||
HassMediaUnpause: | ||
default: "Unpaused" | ||
default: "Resumed" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
language: en | ||
responses: | ||
intents: | ||
HassPauseTimer: | ||
default: "Timer paused" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
language: en | ||
responses: | ||
intents: | ||
HassStartTimer: | ||
default: "Timer started" | ||
command: "Command received" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
--- | ||
language: en | ||
responses: | ||
intents: | ||
HassTimerStatus: | ||
default: | | ||
{% set num_timers = slots.timers | length %} | ||
{% set active_timers = slots.timers | selectattr('is_active') | list %} | ||
{% set num_active_timers = active_timers | length %} | ||
{% set paused_timers = slots.timers | rejectattr('is_active') | list %} | ||
{% set num_paused_timers = paused_timers | length %} | ||
{% set next_timer = None %} | ||
{% if num_timers == 0: %} | ||
No timers. | ||
{% elif num_active_timers == 0: %} | ||
{# No active timers #} | ||
{% if num_paused_timers == 1: %} | ||
{% set next_timer = paused_timers[0] %} | ||
Timer is paused. | ||
{% else: %} | ||
{{ num_paused_timers }} paused timers. | ||
{% endif %} | ||
{% else: %} | ||
{# At least one active timer #} | ||
{% if num_active_timers == 1: %} | ||
{% set next_timer = active_timers[0] %} | ||
{% else: %} | ||
{# Get active timer that will finish soonest #} | ||
{% set sorted_timers = active_timers | sort(attribute='total_seconds_left') %} | ||
{% set next_timer = sorted_timers[0] %} | ||
{{ num_active_timers }} running timers. | ||
{% endif %} | ||
{% if num_paused_timers == 1: %} | ||
1 paused timer. | ||
{% elif num_paused_timers > 0: %} | ||
{{ num_paused_timers }} paused timers. | ||
{% endif %} | ||
{% endif %} | ||
{% if next_timer: %} | ||
{# At least one active timer #} | ||
{% if (next_timer.rounded_hours_left == 1) and (next_timer.rounded_minutes_left > 0): %} | ||
1 hour and {{ next_timer.rounded_minutes_left }} minutes | ||
{% elif (next_timer.rounded_hours_left == 1): %} | ||
1 hour | ||
{% elif (next_timer.rounded_hours_left > 1) and (next_timer.rounded_minutes_left > 0): %} | ||
{{ next_timer.rounded_hours_left }} hours and {{ next_timer.rounded_minutes_left }} minutes | ||
{% elif (next_timer.rounded_hours_left > 1): %} | ||
{{ next_timer.rounded_hours_left }} hours | ||
{% elif (next_timer.rounded_minutes_left == 1) and (next_timer.rounded_seconds_left > 0): %} | ||
1 minute and {{ next_timer.rounded_seconds_left }} seconds | ||
{% elif (next_timer.rounded_minutes_left == 1): %} | ||
1 minute | ||
{% elif (next_timer.rounded_minutes_left > 1) and (next_timer.rounded_seconds_left > 0): %} | ||
{{ next_timer.rounded_minutes_left }} minutes and {{ next_timer.rounded_seconds_left }} seconds | ||
{% elif (next_timer.rounded_minutes_left > 1): %} | ||
{{ next_timer.rounded_minutes_left }} minutes | ||
{% elif (next_timer.rounded_seconds_left == 1): %} | ||
1 second | ||
{% elif (next_timer.rounded_seconds_left > 1): %} | ||
{{ next_timer.rounded_seconds_left }} seconds | ||
{% endif %} | ||
{% if num_timers > 1: %} | ||
{# Give some extra information to disambiguate #} | ||
left on | ||
{% if (next_timer.start_hours > 0) and (next_timer.start_minutes > 0): %} | ||
{{ next_timer.start_hours }} hour and {{ next_timer.start_minutes }} minute | ||
{% elif (next_timer.start_hours > 0): %} | ||
{{ next_timer.start_hours }} hour | ||
{% elif (next_timer.start_minutes > 0) and (next_timer.start_seconds > 0): %} | ||
{{ next_timer.start_minutes }} minute and {{ next_timer.start_seconds }} second | ||
{% elif (next_timer.start_minutes > 0): %} | ||
{{ next_timer.start_minutes }} minute | ||
{% elif (next_timer.start_seconds > 0): %} | ||
{{ next_timer.start_seconds }} second | ||
{% endif %} | ||
{% if next_timer.name: %} | ||
{{ next_timer.name }} | ||
{% elif next_timer.area: %} | ||
{{ next_timer.area }} | ||
{% endif %} | ||
timer. | ||
{% else: %} | ||
left. | ||
{% endif %} | ||
{% endif %} |
Oops, something went wrong.