Skip to content

Commit

Permalink
fix dryer time left
Browse files Browse the repository at this point in the history
  • Loading branch information
jumping2000 committed Sep 8, 2023
1 parent 6fa1336 commit 54b087e
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions elettrodomestici_2023/packages/elettrodomestici/dryer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,26 @@
availability: >
{{ states('input_number.asciugatrice_runtime') not in ['unavailable', 'unknown', 'none'] }}
- name: dryer_time_left
state: >
{% set timer = ((states.input_datetime.asciugatrice_time_end.attributes.timestamp - as_timestamp(now())) / 60 ) | round(0) | default(1) %}
{% if states('sensor.dryer_status') != 'Idle' %}
{{ timer if timer>0 else 0 }} min
{% else %}
{% set program = states('input_select.asciugatrice_program') | default("Off") %}
{% set dict_time_program = {
'Daily': '00:45:00',
'Lana':'01:10:00',
'Risparmio': '00:30:00',
'Sintetici': '00:20:00',
'Relax': '00:15:00',
'Accappatoi': '00:40:00',
'Off': '00:00:00' } %}
{{ dict_time_program[program] if program in dict_time_program else '00:00:00'}}
{% endif %}
availability: >
{{ states('input_datetime.asciugatrice_time_end') not in ['unavailable', 'unknown', 'none'] }}
- name: asciugatrice_modulo_manutenzione
state: >
{%- set value1 = states('counter.cicli_asciugatrice') |int(default=0) -%}
Expand Down Expand Up @@ -309,26 +329,6 @@
availability: >
{{ states('counter.cicli_asciugatrice') not in ['unavailable', 'unknown', 'none'] }}
- name: dryer_time_left
state: >
{% set timer = ((states.input_datetime.asciugatrice_time_end.attributes.timestamp - as_timestamp(now())) / 60 ) | round(0) | default(1) %}
{% if states('sensor.dryer_status') != 'Idle' %}
{{ timer if timer>0 else 0 }} min
{% else %}
{% set program = states('input_select.asciugatrice_program') | default("Off") %}
{% set dict_time_program = {
'Daily': '00:45:00',
'Lana':'01:10:00',
'Risparmio': '00:30:00',
'Sintetici': '00:20:00',
'Relax': '00:15:00',
'Accappatoi': '00:40:00',
'Off': '00:00:00' } %}
{{ dict_time_program[program] if program in dict_time_program else '00:00:00'}}
{% endif %}
availability: >
{{ states('input_datetime.asciugatrice_time_end') not in ['unavailable', 'unknown', 'none'] }}
#################################################################
# #
# UTILITY METER #
Expand Down

0 comments on commit 54b087e

Please sign in to comment.