mirror of
https://github.com/HASwitchPlate/HASPone.git
synced 2025-08-04 17:07:46 +00:00
Add ability to round off temperature values
This commit is contained in:
parent
1eb8704872
commit
cac29ccafa
@ -190,6 +190,12 @@ blueprint:
|
|||||||
default: false
|
default: false
|
||||||
selector:
|
selector:
|
||||||
boolean:
|
boolean:
|
||||||
|
roundtemp:
|
||||||
|
name: "Round sensor values to nearest integer"
|
||||||
|
description: "Enable this if you don't want decimal places involved"
|
||||||
|
default: true
|
||||||
|
selector:
|
||||||
|
boolean:
|
||||||
|
|
||||||
mode: parallel
|
mode: parallel
|
||||||
max_exceeded: silent
|
max_exceeded: silent
|
||||||
@ -225,11 +231,12 @@ variables:
|
|||||||
thermometer_full_threshold: !input thermometer_full_threshold
|
thermometer_full_threshold: !input thermometer_full_threshold
|
||||||
thermometer_full_color: !input thermometer_full_color
|
thermometer_full_color: !input thermometer_full_color
|
||||||
colortemp: !input colortemp
|
colortemp: !input colortemp
|
||||||
|
roundtemp: !input roundtemp
|
||||||
haspobject: '{{ "p[" ~ hasppage ~ "].b[" ~ haspbutton ~ "]" }}'
|
haspobject: '{{ "p[" ~ hasppage ~ "].b[" ~ haspbutton ~ "]" }}'
|
||||||
commandtopic: '{{ "hasp/" ~ haspname ~ "/command/" ~ haspobject }}'
|
commandtopic: '{{ "hasp/" ~ haspname ~ "/command/" ~ haspobject }}'
|
||||||
jsoncommandtopic: '{{ "hasp/" ~ haspname ~ "/command/json" }}'
|
jsoncommandtopic: '{{ "hasp/" ~ haspname ~ "/command/json" }}'
|
||||||
jsontopic: '{{ "hasp/" ~ haspname ~ "/state/json" }}'
|
jsontopic: '{{ "hasp/" ~ haspname ~ "/state/json" }}'
|
||||||
temperature: >-
|
temperature_value: >-
|
||||||
{%- if temperature_sensor|lower == "none" -%}
|
{%- if temperature_sensor|lower == "none" -%}
|
||||||
{{- state_attr(weather_provider, "temperature") -}}
|
{{- state_attr(weather_provider, "temperature") -}}
|
||||||
{%- elif temperature_attribute|lower == "state" -%}
|
{%- elif temperature_attribute|lower == "state" -%}
|
||||||
@ -237,6 +244,12 @@ variables:
|
|||||||
{%- else -%}
|
{%- else -%}
|
||||||
{{- state_attr(temperature_sensor, temperature_attribute) -}}
|
{{- state_attr(temperature_sensor, temperature_attribute) -}}
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
temperature: >-
|
||||||
|
{%- if roundtemp == true -%}
|
||||||
|
{{- temperature_value | round -}}
|
||||||
|
{%- else -%}
|
||||||
|
{{- temperature_value -}}
|
||||||
|
{%- endif -%}
|
||||||
icon: >-
|
icon: >-
|
||||||
{%- set temp = temperature|int -%}
|
{%- set temp = temperature|int -%}
|
||||||
{%- if temp <= thermometer_quarter_threshold|int -%}
|
{%- if temp <= thermometer_quarter_threshold|int -%}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user