wernerhp / ha.integration.load_shedding

A Home Assistant integration to track your load schedding schedule.
MIT License
113 stars 21 forks source link

End time optimization #54

Open dreamcodeza opened 1 year ago

dreamcodeza commented 1 year ago

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%}

KortgatGH commented 1 year ago

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