mirror of
https://github.com/GeorgeSG/sarah.git
synced 2026-05-13 19:54:42 +00:00
Add degrees to progress button
This commit is contained in:
@@ -7,6 +7,7 @@ progress:
|
||||
low_color: "var(--primary-color)"
|
||||
normal_color: "var(--color-green)"
|
||||
high_color: "var(--color-red)"
|
||||
degrees: 180
|
||||
show_state: true
|
||||
show_name: true
|
||||
styles:
|
||||
@@ -42,6 +43,7 @@ progress:
|
||||
: variables.high_color;
|
||||
var percent = (temp - variables.min_value)/(variables.max_value - variables.min_value) * 100;
|
||||
var gradient = 100 - percent;
|
||||
var degrees = variables.degrees + "deg";
|
||||
|
||||
return 'linear-gradient(180deg, var(--paper-card-background-color) 0%, var(--paper-card-background-color)' + gradient + '%, ' + color + ' ' + gradient + '%)'
|
||||
return 'linear-gradient('+ degrees +', var(--paper-card-background-color) 0%, var(--paper-card-background-color)' + gradient + '%, ' + color + ' ' + gradient + '%)'
|
||||
]]]
|
||||
|
||||
@@ -205,6 +205,8 @@
|
||||
- progress
|
||||
name: Temperature
|
||||
entity: sensor.bedroom_weather_temperature
|
||||
variables:
|
||||
degrees: 200
|
||||
- type: custom:button-card
|
||||
template:
|
||||
- small
|
||||
@@ -219,6 +221,7 @@
|
||||
low_color: "var(--color-red)"
|
||||
normal_color: "var(--color-green)"
|
||||
high_color: "var(--color-red)"
|
||||
degrees: 200
|
||||
|
||||
- type: vertical-stack
|
||||
title: Sensors
|
||||
|
||||
Reference in New Issue
Block a user