feat(hass): add pause and unpause voice commands for timers
All checks were successful
Discord / discord commits (push) Has been skipped
All checks were successful
Discord / discord commits (push) Has been skipped
This commit is contained in:
parent
4891913471
commit
4ca020a6da
1 changed files with 74 additions and 7 deletions
|
@ -87,14 +87,81 @@ in [
|
|||
};
|
||||
}
|
||||
|
||||
{
|
||||
spec = {
|
||||
name = "timer_pause";
|
||||
description = "Use this function to pause a timer in Home Assistant.";
|
||||
|
||||
parameters = {
|
||||
type = "object";
|
||||
|
||||
properties = {
|
||||
timer_number = {
|
||||
type = "string";
|
||||
description = "The number of the timer";
|
||||
enum = ["1" "2" "3"];
|
||||
};
|
||||
};
|
||||
|
||||
required = ["timer_number"];
|
||||
};
|
||||
};
|
||||
|
||||
function = {
|
||||
type = "script";
|
||||
|
||||
sequence = [
|
||||
{
|
||||
service = "script.assist_timerpause";
|
||||
|
||||
target.entity_id = ''{{ "timer.assist_timer" ~ timer_number }}'';
|
||||
|
||||
data = {
|
||||
timer_action = "pause";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
spec = {
|
||||
name = "timer_unpause";
|
||||
description = "Use this function to unpause or resume a timer in Home Assistant.";
|
||||
|
||||
parameters = {
|
||||
type = "object";
|
||||
|
||||
properties = {
|
||||
timer_number = {
|
||||
type = "string";
|
||||
description = "The number of the timer";
|
||||
enum = ["1" "2" "3"];
|
||||
};
|
||||
};
|
||||
|
||||
required = ["timer_number"];
|
||||
};
|
||||
};
|
||||
|
||||
function = {
|
||||
type = "script";
|
||||
|
||||
sequence = [
|
||||
{
|
||||
service = "script.assist_timerpause";
|
||||
|
||||
target.entity_id = ''{{ "timer.assist_timer" ~ timer_number }}'';
|
||||
|
||||
data = {
|
||||
timer_action = "resume";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
/*
|
||||
TimerPause:
|
||||
async_action: true
|
||||
action:
|
||||
- service: script.assist_TimerPause
|
||||
data:
|
||||
entity_id: "{{ entity_id }}"
|
||||
timer_action: "{{ timer_action }}"
|
||||
TimerDuration:
|
||||
async_action: true
|
||||
action:
|
||||
|
|
Loading…
Reference in a new issue