Skip to content

Commit

Permalink
issue with empty transaction #121 #124
Browse files Browse the repository at this point in the history
  • Loading branch information
leeyuentuen committed Jun 11, 2024
1 parent e45a2fc commit 338cd91
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion custom_components/alfen_wallbox/alfen.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,14 @@ async def _get_transaction(self):
#_LOGGER.debug(response)
# split this text into lines with \n
lines = str(response).splitlines()

# if the lines are empty, break the loop
if not lines or not response:
transactionLoop = False
break

for line in lines:
if line is None or response is None:
if line is None:
transactionLoop = False
break

Expand Down Expand Up @@ -418,6 +424,10 @@ async def _get_transaction(self):

elif 'dto' in line:
continue
elif '0_Empty' in line:
# break if the transaction is empty
transactionLoop = False
break
else:
_LOGGER.debug(f"Unknown line: {line}")
continue
Expand Down

0 comments on commit 338cd91

Please sign in to comment.