This commit is contained in:
2020-05-06 04:32:08 +03:00
parent 94581b73b9
commit 9217caba9e
22 changed files with 94 additions and 48 deletions
+22
View 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
@@ -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%
@@ -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
@@ -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,7 +146,11 @@
- 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:
@@ -335,4 +339,3 @@
variables: variables:
- player: media_player.bathroom - player: media_player.bathroom
- name: Bathroom - name: Bathroom
@@ -47,7 +47,11 @@
- 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:
@@ -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
+7 -2
View File
@@ -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:
-1
View File
@@ -104,4 +104,3 @@ automation:
action: action:
- service: switch.toggle - service: switch.toggle
entity_id: switch.titanium entity_id: switch.titanium
-1
View File
@@ -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
@@ -69,4 +69,3 @@ automation:
{% else %} {% else %}
100 100
{% endif %} {% endif %}
-1
View File
@@ -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') }}"
+3 -1
View File
@@ -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
+3 -1
View File
@@ -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