The event is filtered out, even though it clearly intersects with the interval 1:00 .. 2:00.
I prepared a quick and dirty fix in #15 to ensure proper check for intersecting intervals. I believe, though, that the code can be simplified: it seems that it's enough to check event_start <= start_date <= event_end, end_date seems to me unneeded in this function, but I might be missing some clever idea.
The recent commit https://github.com/denysdovhan/ha-yasno-outages/commit/6809d1001b8dd3e907243f80447ff3fd8dee0aad introduced a regression:
sensor.yasno_group_X_electricity
has a high chance of displaying "Connected" when it's an outage. The bug is in this check: for example, if there is an outage from 0:00 till 4:00, and right now is 1:00, we'll have:The event is filtered out, even though it clearly intersects with the interval 1:00 .. 2:00.
I prepared a quick and dirty fix in #15 to ensure proper check for intersecting intervals. I believe, though, that the code can be simplified: it seems that it's enough to check
event_start <= start_date <= event_end
, end_date seems to me unneeded in this function, but I might be missing some clever idea.