Skip to content

Commit

Permalink
Fix nullpointer in evu calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
BenPru committed Dec 30, 2022
1 parent a9c701f commit dd04b0a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion custom_components/luxtronik/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"domain": "luxtronik2",
"name": "Luxtronik",
"version": "2022.12.24",
"version": "2022.12.30",
"integration_type": "hub",
"config_flow": true,
"iot_class": "local_polling",
Expand Down
2 changes: 1 addition & 1 deletion custom_components/luxtronik/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@ def update(self):
time_now = time(datetime.now().hour, datetime.now().minute)
if self.native_value is not None and self._last_state is not None and self.native_value == LUX_STATUS_EVU and self._last_state != LUX_STATUS_EVU:
# evu start
if self._first_evu_start_time is None or time_now.hour <= self._first_evu_start_time.hour or time_now.hour <= self._second_evu_start_time or time_now.hour <= self._first_evu_end_time.hour:
if self._first_evu_start_time is None or time_now.hour <= self._first_evu_start_time.hour or (self._second_evu_start_time is not None and time_now.hour <= self._second_evu_start_time.hour) or time_now.hour <= self._first_evu_end_time.hour:
self._first_evu_start_time = time_now
else:
self._second_evu_start_time = time_now
Expand Down

0 comments on commit dd04b0a

Please sign in to comment.