mirror of
https://github.com/GeorgeSG/sarah.git
synced 2026-06-21 10:57:43 +00:00
Move config out of subfolder
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
v3_badge:
|
||||
variables:
|
||||
state_size: 14px
|
||||
show_name: false
|
||||
show_icon: false
|
||||
show_state: true
|
||||
hold_action:
|
||||
action: more-info
|
||||
styles:
|
||||
card:
|
||||
- width: 60px
|
||||
- height: 60px
|
||||
- font-size: 15px
|
||||
- border-radius: 60px
|
||||
- box-shadow: none
|
||||
- --ha-card-background: transparent
|
||||
- border: 2px solid rgba(255, 255, 255, 0.5)
|
||||
state:
|
||||
- text-overflow: initial
|
||||
- width: 80%
|
||||
- font-weight: bold
|
||||
- font-size: "[[[ return variables.state_size ]]]"
|
||||
@@ -0,0 +1,17 @@
|
||||
v3_badge_icon:
|
||||
template: v3_badge
|
||||
show_state: false
|
||||
show_icon: true
|
||||
styles:
|
||||
icon:
|
||||
- transform: translateX(-4px) translateY(11px)
|
||||
- --mdc-icon-size: 30px
|
||||
- color: white
|
||||
state:
|
||||
- value: 'on'
|
||||
styles:
|
||||
card:
|
||||
- background-color: white
|
||||
- color: black
|
||||
icon:
|
||||
- color: var(--primary-color)
|
||||
@@ -0,0 +1,64 @@
|
||||
v3_button:
|
||||
variables:
|
||||
value_has_error: false
|
||||
background_color: 'var(--v3-background)'
|
||||
|
||||
show_state: true
|
||||
show_icon: true
|
||||
show_name: true
|
||||
size: 120px
|
||||
card_size: 2
|
||||
hold_action:
|
||||
action: more-info
|
||||
styles:
|
||||
card:
|
||||
- width: 120px
|
||||
- height: 120px
|
||||
- box-shadow: none
|
||||
- --ha-card-background: "[[[ return variables.background_color ]]]"
|
||||
icon:
|
||||
- position: absolute
|
||||
- top: 8px
|
||||
- left: 16px
|
||||
- width: 30px
|
||||
- height: 30px
|
||||
- --mdc-icon-size: 30px
|
||||
- color: white
|
||||
state:
|
||||
- position: absolute
|
||||
- bottom: 10px
|
||||
- left: 16px
|
||||
- font-weight: bold
|
||||
- font-size: 14px
|
||||
- color: "[[[ return variables.value_has_error ? 'red' : 'white' ]]]"
|
||||
name:
|
||||
- position: absolute
|
||||
- left: 16px
|
||||
- bottom: "[[[ return this.___config.show_state ? '28px' : '10px'; ]]]"
|
||||
- white-space: normal
|
||||
- word-wrap: break-word
|
||||
- word-break: break-word
|
||||
- width: 90px
|
||||
- text-align: left
|
||||
- font-weight: bold
|
||||
- font-size: 15px
|
||||
state:
|
||||
- value: 'on'
|
||||
styles: &on_styles
|
||||
card:
|
||||
- background-color: white
|
||||
- color: black
|
||||
icon:
|
||||
- color: var(--primary-color)
|
||||
state:
|
||||
- color: "[[[ return variables.value_has_error ? 'red' : 'var(--v3-btn-state-color)' ]]]"
|
||||
- value: 'home'
|
||||
styles: *on_styles
|
||||
- value: 'recording'
|
||||
styles: *on_styles
|
||||
- value: 'open'
|
||||
styles: *on_styles
|
||||
- value: 'playing'
|
||||
styles: *on_styles
|
||||
- value: 'heat'
|
||||
styles: *on_styles
|
||||
@@ -0,0 +1,29 @@
|
||||
v3_pill:
|
||||
show_name: true
|
||||
show_icon: true
|
||||
show_state: false
|
||||
card_size: 5
|
||||
hold_action:
|
||||
action: more-info
|
||||
styles:
|
||||
card:
|
||||
- width: 380px
|
||||
- margin-left: 8px
|
||||
- height: 60px
|
||||
- font-size: 15px
|
||||
- border-radius: 8px
|
||||
- background-color: 'rgba(70, 70, 70, 1)'
|
||||
icon:
|
||||
- position: absolute
|
||||
- left: 16px
|
||||
- width: 30px
|
||||
- --mdc-icon-size: 30px
|
||||
- display: flex
|
||||
- align-items: center
|
||||
name:
|
||||
- position: absolute
|
||||
- top: 22px
|
||||
- left: 60px
|
||||
- width: 180px
|
||||
- font-weight: bold
|
||||
- text-align: left
|
||||
@@ -0,0 +1,6 @@
|
||||
v3_popup_button:
|
||||
variables:
|
||||
background_color: rgba(60, 60, 60, 1)
|
||||
styles:
|
||||
card:
|
||||
- margin-bottom: 8px
|
||||
@@ -0,0 +1,48 @@
|
||||
v3_scene:
|
||||
variables:
|
||||
scene_color_1: rgb(255, 255, 255)
|
||||
scene_color_2: rgb(255, 255, 255)
|
||||
degrees: 315
|
||||
show_name: true
|
||||
show_icon: true
|
||||
show_state: false
|
||||
card_size: 5
|
||||
tap_action:
|
||||
action: call-service
|
||||
service: scene.turn_on
|
||||
service_data:
|
||||
entity_id: "[[[ return entity.entity_id ]]]"
|
||||
hold_action:
|
||||
action: more-info
|
||||
styles:
|
||||
card:
|
||||
- width: 250px
|
||||
- height: 60px
|
||||
- font-size: 15px
|
||||
- box-shadow: none
|
||||
- background: >
|
||||
[[[
|
||||
const color_1 = variables.scene_color_1;
|
||||
const color_2 = variables.scene_color_2 || variables.scene_color_1;
|
||||
const degrees = variables.degrees;
|
||||
|
||||
return "linear-gradient("
|
||||
+ degrees + "deg, "
|
||||
+ color_1 + " 14%, "
|
||||
+ color_2 + " 14%, "
|
||||
+ color_2 + " 24%, var(--v3-background) 24%)"
|
||||
]]]
|
||||
icon:
|
||||
- position: absolute
|
||||
- left: 16px
|
||||
- width: 30px
|
||||
- --mdc-icon-size: 30px
|
||||
- display: flex
|
||||
- align-items: center
|
||||
name:
|
||||
- position: absolute
|
||||
- top: 22px
|
||||
- left: 60px
|
||||
- width: 180px
|
||||
- font-weight: bold
|
||||
- text-align: left
|
||||
@@ -0,0 +1,21 @@
|
||||
v3_tablet_button:
|
||||
template: v3_button
|
||||
styles:
|
||||
card:
|
||||
- width: 100px
|
||||
- height: 100px
|
||||
- border-radius: 16px
|
||||
icon:
|
||||
- top: 4px
|
||||
- left: 12px
|
||||
- width: 20px
|
||||
- height: 20px
|
||||
- --mdc-icon-size: 20px
|
||||
state:
|
||||
- bottom: 4px
|
||||
- left: 12px
|
||||
name:
|
||||
- left: 12px
|
||||
- bottom: 22px
|
||||
- width: 60px
|
||||
- font-size: 13px
|
||||
@@ -0,0 +1,22 @@
|
||||
v3_xs_button:
|
||||
template: v3_button
|
||||
show_state: false
|
||||
styles:
|
||||
card:
|
||||
- width: 75px
|
||||
- height: 75px
|
||||
- border-radius: 12px
|
||||
icon:
|
||||
- top: 4px
|
||||
- left: 12px
|
||||
- width: 20px
|
||||
- height: 20px
|
||||
- --mdc-icon-size: 20px
|
||||
name:
|
||||
- left: 12px
|
||||
- bottom: 8px
|
||||
- white-space: normal
|
||||
- word-wrap: break-word
|
||||
- word-break: break-word
|
||||
- width: 60px
|
||||
- font-size: 13px
|
||||
@@ -0,0 +1,3 @@
|
||||
v3_badge_humidity:
|
||||
template: v3_badge
|
||||
state_display: "[[[ return Number.parseFloat(entity.state.split(' ')[0]).toFixed(1) + '%' ]]]"
|
||||
@@ -0,0 +1,3 @@
|
||||
v3_badge_temp:
|
||||
template: v3_badge
|
||||
state_display: "[[[ return Number.parseFloat(entity.state.split(' ')[0]).toFixed(1) + '°' ]]]"
|
||||
@@ -0,0 +1,27 @@
|
||||
v3_button_ac:
|
||||
template: v3_button
|
||||
icon: mdi:air-conditioner
|
||||
state_display: |
|
||||
[[[
|
||||
if (!entity) {
|
||||
return "Unavailable";
|
||||
}
|
||||
|
||||
if (entity.state === "off") {
|
||||
return "Off";
|
||||
}
|
||||
return entity.attributes.hvac_action.charAt(0).toUpperCase() +
|
||||
entity.attributes.hvac_action.slice(1) + ' to ' +
|
||||
entity.attributes.temperature + '°';
|
||||
]]]
|
||||
state:
|
||||
- value: 'off'
|
||||
operator: '!='
|
||||
styles:
|
||||
card:
|
||||
- background-color: white
|
||||
- color: black
|
||||
icon:
|
||||
- color: var(--primary-color)
|
||||
state:
|
||||
- color: black
|
||||
@@ -0,0 +1,80 @@
|
||||
v3_button_brita_water:
|
||||
template: v3_button
|
||||
name: Brita water
|
||||
entity: script.brita_pour_water
|
||||
variables:
|
||||
long_state: true
|
||||
state_display: |
|
||||
[[[
|
||||
return Math.round(states['input_number.brita_remaining_liters'].state) +
|
||||
(variables.long_state ? 'L Remaining' : 'L')
|
||||
]]]
|
||||
tap_action:
|
||||
action: toggle
|
||||
styles:
|
||||
card:
|
||||
- background: >
|
||||
[[[
|
||||
const remaining = states['input_number.brita_remaining_liters'].state;
|
||||
const percent = 100 - (remaining / 150 * 100);
|
||||
|
||||
const gradient = [
|
||||
'180deg',
|
||||
'var(--v3-background) 0%',
|
||||
`var(--v3-background) ${percent}%`,
|
||||
`white ${percent}%`
|
||||
]
|
||||
|
||||
return `linear-gradient(${gradient.join(',')})`;
|
||||
]]]
|
||||
name:
|
||||
- color: |
|
||||
[[[
|
||||
const remaining = states['input_number.brita_remaining_liters'].state;
|
||||
const percent = remaining / 150 * 100;
|
||||
return percent > 25 ? 'black' : 'white';
|
||||
]]]
|
||||
- background-color: |
|
||||
[[[
|
||||
const remaining = states['input_number.brita_remaining_liters'].state;
|
||||
const percent = remaining / 150 * 100;
|
||||
return percent > 25 ? 'white' : 'transparent';
|
||||
]]]
|
||||
- border-radius: 4px
|
||||
|
||||
icon:
|
||||
- color: |
|
||||
[[[
|
||||
const remaining = states['input_number.brita_remaining_liters'].state;
|
||||
const percent = remaining / 150 * 100;
|
||||
return percent > 65 ? 'var(--primary-color)' : 'white';
|
||||
]]]
|
||||
- background-color: |
|
||||
[[[
|
||||
const remaining = states['input_number.brita_remaining_liters'].state;
|
||||
const percent = remaining / 150 * 100;
|
||||
return percent > 65 ? 'white' : 'transparent';
|
||||
]]]
|
||||
- border-radius: 4px
|
||||
|
||||
state:
|
||||
- position: absolute
|
||||
- bottom: 10px
|
||||
- left: 16px
|
||||
- font-weight: bold
|
||||
- font-size: 13px
|
||||
- color: |
|
||||
[[[
|
||||
if (states['binary_sensor.brita_should_change_filter'].state === 'on') { return 'red'; }
|
||||
|
||||
const remaining = states['input_number.brita_remaining_liters'].state;
|
||||
const percent = remaining / 150 * 100;
|
||||
return percent > 10 ? 'var(--v3-btn-state-color)' : 'white';
|
||||
]]]
|
||||
- background-color: |
|
||||
[[[
|
||||
const remaining = states['input_number.brita_remaining_liters'].state;
|
||||
const percent = remaining / 150 * 100;
|
||||
return percent > 10 ? 'white' : 'transparent';
|
||||
]]]
|
||||
- border-radius: 4px
|
||||
@@ -0,0 +1,7 @@
|
||||
v3_button_cover:
|
||||
template: [v3_button, cover]
|
||||
state_display: |
|
||||
[[[
|
||||
if (entity.state === 'closed') { return 'Closed' }
|
||||
return entity.attributes.current_position + '% Open';
|
||||
]]]
|
||||
@@ -0,0 +1,7 @@
|
||||
v3_button_light:
|
||||
template: v3_button
|
||||
state_display: |
|
||||
[[[
|
||||
if (entity.state === 'off') { return 'Off'; }
|
||||
return Math.round(entity.attributes.brightness * 100 / 255) + "%";
|
||||
]]]
|
||||
@@ -0,0 +1,22 @@
|
||||
v3_button_person:
|
||||
template: v3_badge
|
||||
show_state: false
|
||||
show_icon: false
|
||||
show_name: false
|
||||
hold_action:
|
||||
action: more-info
|
||||
styles:
|
||||
card:
|
||||
- width: 60px
|
||||
- height: 60px
|
||||
- border-radius: 60px
|
||||
- background-repeat: no-repeat
|
||||
- background-position: center center
|
||||
- background-size: cover
|
||||
- border-color: var(--accent-color)
|
||||
state:
|
||||
- value: 'off'
|
||||
styles:
|
||||
card:
|
||||
- filter: grayscale(100%)
|
||||
- border-color: black
|
||||
@@ -0,0 +1,13 @@
|
||||
v3_button_power:
|
||||
template: v3_button
|
||||
variables:
|
||||
power_sensor:
|
||||
state_display: |
|
||||
[[[
|
||||
if (entity.state === 'off') return 'Off';
|
||||
return states[variables.power_sensor].state + " W";
|
||||
]]]
|
||||
icon: mdi:power-socket
|
||||
tap_action:
|
||||
action: more-info
|
||||
entity: "[[[return variables.power_sensor]]]"
|
||||
@@ -0,0 +1,13 @@
|
||||
v3_button_purifier:
|
||||
template: v3_button
|
||||
state_display: |
|
||||
[[[
|
||||
if (entity.state === 'off') { return 'Off'; }
|
||||
if (!entity.attributes.preset_mode) { return 'Unknown preset'; }
|
||||
return entity.attributes.preset_mode.charAt(0).toUpperCase() + entity.attributes.preset_mode.slice(1);
|
||||
]]]
|
||||
variables:
|
||||
value_has_error: |
|
||||
[[[
|
||||
return states['binary_sensor.purifier_filter_needs_change'].state === 'on';
|
||||
]]]
|
||||
@@ -0,0 +1,15 @@
|
||||
v3_button_radiator:
|
||||
template: v3_button
|
||||
icon: mdi:radiator
|
||||
state_display: |
|
||||
[[[
|
||||
if (entity.state === 'off') { return 'Off'};
|
||||
return entity.state.charAt(0).toUpperCase() +
|
||||
entity.state.slice(1) + " to " +
|
||||
entity.attributes.temperature + '°';
|
||||
]]]
|
||||
tap_action:
|
||||
action: call-service
|
||||
service: script.toggle_radiator
|
||||
service_data:
|
||||
entity_id: "[[[ return entity.entity_id ]]]"
|
||||
@@ -0,0 +1,21 @@
|
||||
v3_button_tv:
|
||||
template: v3_button
|
||||
tap_action:
|
||||
action: toggle
|
||||
icon: mdi:television
|
||||
state:
|
||||
- value: 'playing'
|
||||
styles: &on_styles
|
||||
card:
|
||||
- background-color: white
|
||||
- color: black
|
||||
icon:
|
||||
- color: var(--primary-color)
|
||||
- value: 'standby'
|
||||
styles: *on_styles
|
||||
- value: 'on'
|
||||
styles: *on_styles
|
||||
- value: 'home'
|
||||
styles: *on_styles
|
||||
- value: 'idle'
|
||||
styles: *on_styles
|
||||
Reference in New Issue
Block a user