Skip to content

Commit

Permalink
Merge pull request #42 from briancmpbll/fix-zero-length-battery-array…
Browse files Browse the repository at this point in the history
…-case

Check for zero length battery array.
  • Loading branch information
briancmpbll authored Jan 13, 2023
2 parents 8b34122 + 06c24a5 commit bf048a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/enphase_envoy_custom/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ async def async_update_data():

elif description.key == "batteries":
battery_data = await envoy_reader.battery_storage()
if isinstance(battery_data, list):
if isinstance(battery_data, list) and len(battery_data) > 0:
battery_dict = {}
for item in battery_data:
battery_dict[item["serial_num"]] = item
Expand Down

0 comments on commit bf048a1

Please sign in to comment.