Skip to content

Commit

Permalink
Add additional None check
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-r committed Jul 8, 2024
1 parent 5ec6a42 commit 0af1968
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/ohme/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def slot_list(data):
slots = []
wh_tally = 0

if 'batterySocBefore' in data and data['batterySocBefore'] is not None:
if 'batterySocBefore' in data and data['batterySocBefore'] is not None and data['batterySocBefore']['wh'] is not None:
wh_tally = data['batterySocBefore']['wh'] # Get the wh value we start from

for slot in session_slots:
Expand Down

0 comments on commit 0af1968

Please sign in to comment.