Skip to content

Commit a2f1f91

Browse files
committed
Update event.py
This condition would never be true and thus we would never get that function to run.
1 parent 01e275c commit a2f1f91

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pyhilo/event.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ def should_check_for_allowed_wh(self) -> bool:
8181
"""This function is used to authorize subscribing to a specific event in Hilo to receive the allowed_kWh
8282
that is made available in the pre_heat phase"""
8383
now = datetime.now(self.preheat_start.tzinfo)
84-
time_since_preheat_start = (self.preheat_start - now).total_seconds()
84+
time_since_preheat_start = (now - self.preheat_start).total_seconds()
8585
already_has_allowed_wh = self.allowed_kWh > 0
86-
return 1800 <= time_since_preheat_start <= 2700 and not already_has_allowed_wh
86+
return 1800 <= time_since_preheat_start < 7200 and not already_has_allowed_wh
8787

8888
def as_dict(self) -> dict[str, Any]:
8989
"""Formats the information received as a dictionary"""

0 commit comments

Comments
 (0)