Add degrees to progress button

This commit is contained in:
2020-04-29 01:00:52 +03:00
parent 0367b6135e
commit c2105763c6
2 changed files with 6 additions and 1 deletions
@@ -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