wernerhp/ha.integration.load_shedding

End time optimization

dreamcodeza opened this issue · 1 comments

I use the end_time variable from your 4th card in some of my automations. I'm not sure if it is just my area or other as well, but when stages change when loadshedding is active it gives me the incorrect end time.

I've made a small change that might be worth including that checks if the next start time is the same as the current end time. If true it sets the end time to the next end time instead.

from:
{% set end_time = area_schedule[0].end_time %}

to:
{% if area_schedule[0].end_time == area_schedule[1].start_time %} {% set end_time = area_schedule[1].end_time %} {%else%} {% set end_time = area_schedule[0].end_time %} {%endif%}

Agree that this is an issue, and it also applies to "ends in* that is incorrect for back-to-back time slots