Skip to content

Commit

Permalink
Fix bug for sites without inverters
Browse files Browse the repository at this point in the history
  • Loading branch information
mcbirse committed Dec 20, 2023
1 parent 3f6bcea commit 31fe40e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pypowerwall/cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,13 @@ def poll(self, api):
grid_power = lookup(power, ("response", "grid_power"))
config = self.get_site_config()
battery_count = lookup(config, ("response", "battery_count"))
solar_inverters = len(lookup(config, ("response", "components", "inverters")) or 0)
inverters = lookup(config, ("response", "components", "inverters"))
if inverters is not None:
solar_inverters = len(inverters)
elif lookup(config, ("response", "components", "solar")):
solar_inverters = 1
else:
solar_inverters = 0

data = {
"site": {
Expand Down

0 comments on commit 31fe40e

Please sign in to comment.