Skip to content

Commit

Permalink
fix-issue-56
Browse files Browse the repository at this point in the history
  • Loading branch information
Petro31 committed Jan 21, 2025
1 parent a5ae339 commit dbbaf91
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions easy_time.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -1288,8 +1288,8 @@
{%- macro _check_for_duration_sensor(input) %}
{%- if input is string and input | regex_search(valid_entity_id_pattern) and input.startswith('sensor') and states[input] is not none and states[input].attributes.device_class is defined and states[input].attributes.unit_of_measurement is defined -%}
{%- set obj = states[input] -%}
{%- set divisor = _duration_sensor.get(obj.attributes.unit_of_measurement) -%}
{{- (obj.state | float / divisor) | string | as_timedelta -}}
{%- set multiplier = _duration_sensor.get(obj.attributes.unit_of_measurement) -%}
{{- (obj.state | float * multiplier) | string | as_timedelta -}}
{%- else %}
{{- '' -}}
{%- endif -%}
Expand Down

0 comments on commit dbbaf91

Please sign in to comment.