mirror of
https://github.com/GeorgeSG/sarah.git
synced 2026-04-29 06:48:16 +00:00
yamllint
This commit is contained in:
22
.yamllint.yaml
Normal file
22
.yamllint.yaml
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
extends: default
|
||||||
|
|
||||||
|
ignore: |
|
||||||
|
config/templates/partials/
|
||||||
|
config/secrets.yaml
|
||||||
|
|
||||||
|
rules:
|
||||||
|
document-start:
|
||||||
|
present: false
|
||||||
|
|
||||||
|
line-length:
|
||||||
|
max: 120
|
||||||
|
level: warning
|
||||||
|
|
||||||
|
truthy:
|
||||||
|
allowed-values:
|
||||||
|
- 'true'
|
||||||
|
- 'false'
|
||||||
|
- 'yes'
|
||||||
|
- 'no'
|
||||||
|
- 'on'
|
||||||
|
- 'off'
|
||||||
@@ -47,9 +47,18 @@ progress:
|
|||||||
: temp < variables.high_value
|
: temp < variables.high_value
|
||||||
? variables.normal_color
|
? variables.normal_color
|
||||||
: variables.high_color;
|
: variables.high_color;
|
||||||
const percent = (temp - variables.min_value)/(variables.max_value - variables.min_value) * 100;
|
|
||||||
const gradient = 100 - percent;
|
|
||||||
const degrees = variables.degrees + "deg";
|
|
||||||
|
|
||||||
return 'linear-gradient('+ degrees +', var(--paper-card-background-color) 0%, var(--paper-card-background-color)' + gradient + '%, ' + color + ' ' + gradient + '%)'
|
const min = variables.min_value;
|
||||||
|
const max = variables.max_value;
|
||||||
|
const percent = Math.round((temp - min)/(max - min) * 100);
|
||||||
|
const gradientPercent = 100 - percent;
|
||||||
|
|
||||||
|
const gradient = [
|
||||||
|
`${variables.degrees}deg`,
|
||||||
|
'var(--paper-card-background-color) 0%',
|
||||||
|
`var(--paper-card-background-color) ${gradientPercent}%`,
|
||||||
|
`${color} ${gradientPercent}%`
|
||||||
|
]
|
||||||
|
|
||||||
|
return `linear-gradient(${gradient.join(',')})`;
|
||||||
]]]
|
]]]
|
||||||
|
|||||||
@@ -12,4 +12,3 @@ small:
|
|||||||
- height: 60px
|
- height: 60px
|
||||||
name:
|
name:
|
||||||
- height: 30px
|
- height: 30px
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
with_state_indicator:
|
with_state_indicator:
|
||||||
variables:
|
variables:
|
||||||
state_indicator_id: # defaults to entity_id
|
state_indicator_id: # defaults to entity_id
|
||||||
|
|
||||||
state_indicator_size: 2px
|
state_indicator_size: 2px
|
||||||
state_indicator_off_size: # If set, used when the state_indicator entity is off
|
state_indicator_off_size: # If set, used when the state_indicator entity is off
|
||||||
|
|
||||||
# state indicators are used when the entity's state is not 'on'
|
# state indicators are used when the entity's state is not 'on'
|
||||||
state_indicator_on_color: white
|
state_indicator_on_color: white
|
||||||
@@ -13,7 +13,7 @@ with_state_indicator:
|
|||||||
state_on_indicator_on_color: white
|
state_on_indicator_on_color: white
|
||||||
state_on_indicator_off_color: transparent
|
state_on_indicator_off_color: transparent
|
||||||
|
|
||||||
triggers_update: all # unfortunately a template doesn't seem to work here :/
|
triggers_update: all # unfortunately a template doesn't seem to work here :/
|
||||||
double_tap_action:
|
double_tap_action:
|
||||||
action: call-service
|
action: call-service
|
||||||
service: homeassistant.toggle
|
service: homeassistant.toggle
|
||||||
|
|||||||
@@ -8,4 +8,3 @@ xs:
|
|||||||
- font-size: 12px
|
- font-size: 12px
|
||||||
name:
|
name:
|
||||||
- height: 24px
|
- height: 24px
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,15 @@ brita_water_card:
|
|||||||
[[[
|
[[[
|
||||||
const remaining = states['input_number.brita_remaining_liters'].state;
|
const remaining = states['input_number.brita_remaining_liters'].state;
|
||||||
const percent = 100 - (remaining / 150 * 100);
|
const percent = 100 - (remaining / 150 * 100);
|
||||||
return 'linear-gradient(180deg, var(--paper-card-background-color) 0%, var(--paper-card-background-color)' + percent + '%, var(--primary-color) ' + percent + '%)'
|
|
||||||
|
const gradient = [
|
||||||
|
'180deg',
|
||||||
|
'var(--paper-card-background-color) 0%',
|
||||||
|
`var(--paper-card-background-color) ${percent}%`,
|
||||||
|
`var(--primary-color) ${percent}%`
|
||||||
|
]
|
||||||
|
|
||||||
|
return `linear-gradient(${gradient.join(',')})`;
|
||||||
]]]
|
]]]
|
||||||
- color: white
|
- color: white
|
||||||
name:
|
name:
|
||||||
|
|||||||
@@ -265,4 +265,3 @@ bulsatcom_remote_card:
|
|||||||
top: 83.5%
|
top: 83.5%
|
||||||
left: 81.5%
|
left: 81.5%
|
||||||
border-radius: 40%
|
border-radius: 40%
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
tap_action:
|
tap_action:
|
||||||
action: none
|
action: none
|
||||||
|
|
||||||
# Living Room
|
# Living Room
|
||||||
- type: conditional
|
- type: conditional
|
||||||
conditions:
|
conditions:
|
||||||
- entity: binary_sensor.floorplan_night_mode
|
- entity: binary_sensor.floorplan_night_mode
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
|
|
||||||
- type: conditional
|
- type: conditional
|
||||||
conditions:
|
conditions:
|
||||||
- entity: input_boolean.floorplan_show_all
|
- entity: input_boolean.floorplan_show_all
|
||||||
state: 'on'
|
state: 'on'
|
||||||
elements:
|
elements:
|
||||||
# Living room ───────────────────────────────────────────────────────────────────────────
|
|
||||||
|
# Living room ───────────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
# Titanium
|
# Titanium
|
||||||
- type: custom:decluttering-card
|
- type: custom:decluttering-card
|
||||||
template: floorplan_state_icon
|
template: floorplan_state_icon
|
||||||
@@ -55,7 +56,7 @@
|
|||||||
- left: 48%
|
- left: 48%
|
||||||
- icon: mdi:video
|
- icon: mdi:video
|
||||||
|
|
||||||
# Master Bedroom ────────────────────────────────────────────────────────────────────────
|
# Master Bedroom ────────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
# Puifier
|
# Puifier
|
||||||
- type: custom:decluttering-card
|
- type: custom:decluttering-card
|
||||||
@@ -76,7 +77,7 @@
|
|||||||
- tap_action:
|
- tap_action:
|
||||||
action: more-info
|
action: more-info
|
||||||
|
|
||||||
# Temperature
|
# Temperature
|
||||||
- type: state-label
|
- type: state-label
|
||||||
entity: sensor.bedroom_weather_temperature
|
entity: sensor.bedroom_weather_temperature
|
||||||
style:
|
style:
|
||||||
@@ -90,7 +91,7 @@
|
|||||||
font-weight: bold
|
font-weight: bold
|
||||||
line-height: 8px
|
line-height: 8px
|
||||||
|
|
||||||
# Kitchen ────────────────────────────────────────────────────────────────────────
|
# Kitchen ────────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
# Sonos
|
# Sonos
|
||||||
- type: custom:decluttering-card
|
- type: custom:decluttering-card
|
||||||
@@ -113,7 +114,7 @@
|
|||||||
- tap_action:
|
- tap_action:
|
||||||
action: more-info
|
action: more-info
|
||||||
|
|
||||||
# Bathroom ────────────────────────────────────────────────────────────────────────
|
# Bathroom ────────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
# Sonos
|
# Sonos
|
||||||
- type: custom:decluttering-card
|
- type: custom:decluttering-card
|
||||||
@@ -126,7 +127,7 @@
|
|||||||
- tap_action:
|
- tap_action:
|
||||||
action: more-info
|
action: more-info
|
||||||
|
|
||||||
# Hallway ────────────────────────────────────────────────────────────────────────
|
# Hallway ────────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
# Motion
|
# Motion
|
||||||
- type: custom:decluttering-card
|
- type: custom:decluttering-card
|
||||||
|
|||||||
@@ -52,4 +52,3 @@
|
|||||||
min_value: 0
|
min_value: 0
|
||||||
max_value: 1000
|
max_value: 1000
|
||||||
normal_value: 1000
|
normal_value: 1000
|
||||||
|
|
||||||
|
|||||||
@@ -202,4 +202,3 @@
|
|||||||
- progress
|
- progress
|
||||||
entity: sensor.multisensor_6_ultraviolet
|
entity: sensor.multisensor_6_ultraviolet
|
||||||
name: Multi UV
|
name: Multi UV
|
||||||
|
|
||||||
|
|||||||
@@ -146,14 +146,18 @@
|
|||||||
- default
|
- default
|
||||||
- with_state_indicator
|
- with_state_indicator
|
||||||
entity: input_boolean.alarm_enabled
|
entity: input_boolean.alarm_enabled
|
||||||
state_display: "[[[return states['input_datetime.alarm_time'].state.split(':').slice(0, -1).join(':'); ]]]"
|
state_display: >-
|
||||||
|
[[[
|
||||||
|
const time = states['input_datetime.alarm_time'].state;
|
||||||
|
return time.split(':').slice(0, -1).join(':');
|
||||||
|
]]]
|
||||||
show_state: true
|
show_state: true
|
||||||
show_name: false
|
show_name: false
|
||||||
styles:
|
styles:
|
||||||
icon:
|
icon:
|
||||||
- transform: translateY(-8px) # adjusted for state indicator size
|
- transform: translateY(-8px) # adjusted for state indicator size
|
||||||
state:
|
state:
|
||||||
- transform: translateY(-13px) # adjusted for state indicator size
|
- transform: translateY(-13px) # adjusted for state indicator size
|
||||||
variables:
|
variables:
|
||||||
state_indicator_id: automation.alarm_set_time
|
state_indicator_id: automation.alarm_set_time
|
||||||
- type: custom:button-card
|
- type: custom:button-card
|
||||||
@@ -335,4 +339,3 @@
|
|||||||
variables:
|
variables:
|
||||||
- player: media_player.bathroom
|
- player: media_player.bathroom
|
||||||
- name: Bathroom
|
- name: Bathroom
|
||||||
|
|
||||||
|
|||||||
@@ -47,14 +47,18 @@
|
|||||||
- default
|
- default
|
||||||
- with_state_indicator
|
- with_state_indicator
|
||||||
entity: input_boolean.alarm_enabled
|
entity: input_boolean.alarm_enabled
|
||||||
state_display: "[[[return states['input_datetime.alarm_time'].state.split(':').slice(0, -1).join(':'); ]]]"
|
state_display: >-
|
||||||
|
[[[
|
||||||
|
const time = states['input_datetime.alarm_time'].state;
|
||||||
|
return time.split(':').slice(0, -1).join(':');
|
||||||
|
]]]
|
||||||
show_state: true
|
show_state: true
|
||||||
show_name: false
|
show_name: false
|
||||||
styles:
|
styles:
|
||||||
icon:
|
icon:
|
||||||
- transform: translateY(-8px) # adjusted for state indicator size
|
- transform: translateY(-8px) # adjusted for state indicator size
|
||||||
state:
|
state:
|
||||||
- transform: translateY(-13px) # adjusted for state indicator size
|
- transform: translateY(-13px) # adjusted for state indicator size
|
||||||
variables:
|
variables:
|
||||||
state_indicator_id: automation.alarm_set_time
|
state_indicator_id: automation.alarm_set_time
|
||||||
- type: custom:button-card
|
- type: custom:button-card
|
||||||
@@ -160,4 +164,3 @@
|
|||||||
name: Hallway
|
name: Hallway
|
||||||
variables:
|
variables:
|
||||||
state_indicator_id: automation.lighting_hallway_day_mode_motion_turn_lights_on
|
state_indicator_id: automation.lighting_hallway_day_mode_motion_turn_lights_on
|
||||||
|
|
||||||
|
|||||||
@@ -20,10 +20,15 @@ binary_sensor:
|
|||||||
brita_should_change_filter:
|
brita_should_change_filter:
|
||||||
friendly_name: Should change Brita filter
|
friendly_name: Should change Brita filter
|
||||||
device_class: problem
|
device_class: problem
|
||||||
value_template: >
|
value_template: >-
|
||||||
|
|
||||||
|
{% set liters_check = states('input_number.brita_remaining_liters')|int < 3 %}
|
||||||
|
|
||||||
{% set next_change = states('input_datetime.brita_next_change') %}
|
{% set next_change = states('input_datetime.brita_next_change') %}
|
||||||
{{ states('input_number.brita_remaining_liters') | int < 3 or (as_timestamp(next_change) - as_timestamp(now())) / (3600*24) | round(0) < 3 }}
|
{% set time_delta = (as_timestamp(next_change) - as_timestamp(now())) %}
|
||||||
|
{% set date_check = time_delta / (3600*24) | round(0) < 3 %}
|
||||||
|
|
||||||
|
{{ liters_check or date_check }}
|
||||||
|
|
||||||
script:
|
script:
|
||||||
brita_pour_water:
|
brita_pour_water:
|
||||||
|
|||||||
@@ -104,4 +104,3 @@ automation:
|
|||||||
action:
|
action:
|
||||||
- service: switch.toggle
|
- service: switch.toggle
|
||||||
entity_id: switch.titanium
|
entity_id: switch.titanium
|
||||||
|
|
||||||
|
|||||||
@@ -60,4 +60,3 @@ automation:
|
|||||||
action:
|
action:
|
||||||
- service: input_select.select_next
|
- service: input_select.select_next
|
||||||
entity_id: input_select.house_mode
|
entity_id: input_select.house_mode
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ automation:
|
|||||||
- light.light_le_12
|
- light.light_le_12
|
||||||
- light.browser_kitchen
|
- light.browser_kitchen
|
||||||
data:
|
data:
|
||||||
brightness_pct: 13 # this is the lowest LE will go ¯\_(ツ)_/¯
|
brightness_pct: 13 # this is the lowest LE will go ¯\_(ツ)_/¯
|
||||||
|
|
||||||
- alias: Lighting · Kitchen · Night mode · Motion · Turn lights off
|
- alias: Lighting · Kitchen · Night mode · Motion · Turn lights off
|
||||||
trigger:
|
trigger:
|
||||||
|
|||||||
@@ -69,4 +69,3 @@ automation:
|
|||||||
{% else %}
|
{% else %}
|
||||||
100
|
100
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|||||||
@@ -20,4 +20,3 @@ script:
|
|||||||
entity_id: media_player.master_bedroom
|
entity_id: media_player.master_bedroom
|
||||||
data_template:
|
data_template:
|
||||||
source: "{{ playlist | default('Evening Chill') }}"
|
source: "{{ playlist | default('Evening Chill') }}"
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ shell_command:
|
|||||||
|
|
||||||
script:
|
script:
|
||||||
youtube_play_file:
|
youtube_play_file:
|
||||||
alias: Youtube · Play file
|
alias: Youtube · Play file
|
||||||
sequence:
|
sequence:
|
||||||
- service: script.sonos_join_bedroom
|
- service: script.sonos_join_bedroom
|
||||||
- service: media_player.play_media
|
- service: media_player.play_media
|
||||||
@@ -65,7 +65,9 @@ script:
|
|||||||
- service: media_player.play_media
|
- service: media_player.play_media
|
||||||
entity_id: media_player.master_bedroom
|
entity_id: media_player.master_bedroom
|
||||||
data_template:
|
data_template:
|
||||||
media_content_id: "{{ states('sensor.sarah_url') }}/local/audio/youtube/{{ states('input_text.youtube_download_name') }}.mp3"
|
media_content_id: >-
|
||||||
|
{% set name = states('input_text.youtube_download_name') %}
|
||||||
|
{{ states('sensor.sarah_url') }}/local/audio/youtube/{{ name }}.mp3
|
||||||
media_content_type: "music"
|
media_content_type: "music"
|
||||||
|
|
||||||
- service: input_text.set_value
|
- service: input_text.set_value
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ script:
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
data_template:
|
data_template:
|
||||||
title: "{{ title | default('💬 *Speech Module*') }}" # For telegram only
|
title: "{{ title | default('💬 *Speech Module*') }}" # For telegram only
|
||||||
message: "{{ message }}"
|
message: "{{ message }}"
|
||||||
|
|
||||||
sonos_blast:
|
sonos_blast:
|
||||||
|
|||||||
@@ -7,7 +7,9 @@ binary_sensor:
|
|||||||
- platform: template
|
- platform: template
|
||||||
sensors:
|
sensors:
|
||||||
floorplan_night_mode:
|
floorplan_night_mode:
|
||||||
value_template: "{{ states('sun.sun') == 'below_horizon' or is_state('input_boolean.floorplan_night_mode', 'on') }}"
|
value_template: >-
|
||||||
|
{{ states('sun.sun') == 'below_horizon'
|
||||||
|
or is_state('input_boolean.floorplan_night_mode', 'on') }}
|
||||||
|
|
||||||
sensor:
|
sensor:
|
||||||
- platform: command_line
|
- platform: command_line
|
||||||
@@ -54,14 +56,14 @@ automation:
|
|||||||
- service: script.say
|
- service: script.say
|
||||||
data:
|
data:
|
||||||
message: "Hey! I was out for a bit, but I'm back online!"
|
message: "Hey! I was out for a bit, but I'm back online!"
|
||||||
# - service: notify.telegram
|
# - service: notify.telegram
|
||||||
# data:
|
# data:
|
||||||
# title: "⚙️ *System Module*"
|
# title: "⚙️ *System Module*"
|
||||||
# message: "Ask me to do something anytime!"
|
# message: "Ask me to do something anytime!"
|
||||||
# data:
|
# data:
|
||||||
# keyboard:
|
# keyboard:
|
||||||
# - "/guest_mode_on, /guest_mode_off"
|
# - "/guest_mode_on, /guest_mode_off"
|
||||||
# - "/status"
|
# - "/status"
|
||||||
|
|
||||||
- alias: System · Telegram · Announce status
|
- alias: System · Telegram · Announce status
|
||||||
trigger:
|
trigger:
|
||||||
|
|||||||
Reference in New Issue
Block a user