mirror of
https://github.com/thejeffreystone/home-assistant-configuration.git
synced 2025-08-20 20:56:44 +00:00
Adding my own simple Jarvis
This commit is contained in:
31
templates/jarvis_confirmations.yaml
Normal file
31
templates/jarvis_confirmations.yaml
Normal file
@@ -0,0 +1,31 @@
|
||||
>
|
||||
{% macro getConfirmation() %}
|
||||
{{ [
|
||||
"OK.",
|
||||
"Sure.",
|
||||
"If you insist.",
|
||||
"I can do that.",
|
||||
"Leave it to me.",
|
||||
"Consider it done.",
|
||||
"As you wish.",
|
||||
"By your command.",
|
||||
"Affirmative.",
|
||||
"No Problem.",
|
||||
"I think I can handle that.",
|
||||
"Working on it now."
|
||||
] | random }}
|
||||
{% endmacro %}
|
||||
{# a macro that removes all newline characters, empty spaces, and returns formatted text #}
|
||||
{%- macro cleanup(data) -%}
|
||||
{%- for item in data.split("\n") if item | trim != "" -%}
|
||||
{{ item | trim }} {% endfor -%}
|
||||
{%- endmacro -%}
|
||||
|
||||
{# a macro to call all macros :) #}
|
||||
{%- macro mother_of_all_macros() -%}
|
||||
{{ getConfirmation() }}
|
||||
|
||||
{%- endmacro -%}
|
||||
|
||||
{# Call the macro #}
|
||||
{{- cleanup(mother_of_all_macros()) -}}
|
23
templates/jarvis_interuptions.yaml
Normal file
23
templates/jarvis_interuptions.yaml
Normal file
@@ -0,0 +1,23 @@
|
||||
>
|
||||
{% macro getInteruption() %}
|
||||
{{ [
|
||||
"Pardon me,",
|
||||
"Excuse me,",
|
||||
"I do not mean to interupt, but.",
|
||||
"I thought you might like to know."
|
||||
] | random }}
|
||||
{% endmacro %}
|
||||
{# a macro that removes all newline characters, empty spaces, and returns formatted text #}
|
||||
{%- macro cleanup(data) -%}
|
||||
{%- for item in data.split("\n") if item | trim != "" -%}
|
||||
{{ item | trim }} {% endfor -%}
|
||||
{%- endmacro -%}
|
||||
|
||||
{# a macro to call all macros :) #}
|
||||
{%- macro mother_of_all_macros() -%}
|
||||
{{ getInteruption() }}
|
||||
|
||||
{%- endmacro -%}
|
||||
|
||||
{# Call the macro #}
|
||||
{{- cleanup(mother_of_all_macros()) -}}
|
23
templates/jarvis_issue.yaml
Normal file
23
templates/jarvis_issue.yaml
Normal file
@@ -0,0 +1,23 @@
|
||||
>
|
||||
{% macro getIssue() %}
|
||||
{{ [
|
||||
"I have detected an issue!",
|
||||
"We have a problem!",
|
||||
"You might not like this.",
|
||||
"There is something that needs your attention."
|
||||
] | random }}
|
||||
{% endmacro %}
|
||||
{# a macro that removes all newline characters, empty spaces, and returns formatted text #}
|
||||
{%- macro cleanup(data) -%}
|
||||
{%- for item in data.split("\n") if item | trim != "" -%}
|
||||
{{ item | trim }} {% endfor -%}
|
||||
{%- endmacro -%}
|
||||
|
||||
{# a macro to call all macros :) #}
|
||||
{%- macro mother_of_all_macros() -%}
|
||||
{{ getIssue() }}
|
||||
|
||||
{%- endmacro -%}
|
||||
|
||||
{# Call the macro #}
|
||||
{{- cleanup(mother_of_all_macros()) -}}
|
Reference in New Issue
Block a user