@@ -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"""
@@ -108,9 +108,8 @@ def _convert_phases(self, phases: dict[str, Any]) -> None:
108108 self .phases_list .append (phase )
109109 for phase in self .__annotations__ :
110110 if phase not in self .phases_list :
111- now_with_tz = datetime .now (timezone .utc ).astimezone ()
112111 # On t'aime Carl
113- setattr (self , phase , now_with_tz )
112+ setattr (self , phase , datetime ( 2099 , 12 , 31 , tzinfo = timezone . utc ) )
114113
115114 def _create_phases (
116115 self , hours : int , phase_name : str , parent_phase : str
0 commit comments