Cleanup some old template binary sensors for weather

This commit is contained in:
2023-03-28 01:08:23 -04:00
parent e58c63dc86
commit 8b6e9bc31c

View File

@ -24,11 +24,7 @@ template:
state: >
{% set temp = states('sensor.pirateweather_temperature') | int %}
{% set threshold = states('input_number.hot_day_threshold') | int %}
{% if temp >= threshold %}
true
{% else %}
false
{% endif %}
{{ temp >= threshold }}
device_class: heat
attributes:
current_temp: "{{ states('sensor.pirateweather_temperature') | int }}"
@ -38,11 +34,7 @@ template:
state: >
{% set feelslike = states('sensor.pirateweather_apparent_temperature') | int %}
{% set threshold = states('input_number.heat_index_threshold') | int %}
{% if feelslike >= threshold %}
true
{% else %}
false
{% endif %}
{{ feelslike >= threshold }}
device_class: heat
attributes:
current_temp: "{{ states('sensor.pirateweather_apparent_temperature') | int }}"
@ -52,11 +44,7 @@ template:
state: >
{% set temp = states('sensor.pirateweather_temperature') | int %}
{% set threshold = states('input_number.cold_day_threshold') | int %}
{% if temp <= threshold %}
true
{% else %}
false
{% endif %}
{{ temp <= threshold }}
device_class: cold
attributes:
current_temp: "{{ states('sensor.pirateweather_temperature') | int }}"
@ -66,11 +54,7 @@ template:
state: >
{% set temp = states('sensor.pirateweather_temperature') | int %}
{% set threshold = states('input_number.overnight_low_threshold') | int%}
{% if temp <= threshold %}
true
{% else %}
false
{% endif %}
{{ temp <= threshold }}
device_class: cold
attributes:
current_temp: "{{ states('sensor.pirateweather_temperature') | int }}"
@ -80,11 +64,7 @@ template:
state: >
{% set feelslike = states('sensor.pirateweather_apparent_temperature') | int %}
{% set threshold = states('input_number.wind_chill_threshold') | int %}
{% if feelslike <= threshold %}
true
{% else %}
false
{% endif %}
{{ feelslike <= threshold }}
device_class: cold
attributes:
current_temp: "{{ states('sensor.pirateweather_temperature') | int }}"