Skip to content

Commit

Permalink
Fix bug caused by API change #41
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonacox committed May 28, 2023
1 parent 7cc0d27 commit 22526d0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/set-mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ def get_powerwall():
if args.debug:
print(f"Retrieving Powerwall data...")

data = battery.get_battery_data()
# data = battery.get_battery_data()
data = battery.api('SITE_CONFIG')['response']
if args.debug:
print(data)
return data
Expand Down Expand Up @@ -296,7 +297,7 @@ def set_mode(mode):
# Read and return current Powerwall operational mode
# self_consumption or autonomous
data = get_powerwall()
mode = data["operation"]
mode = data['default_real_mode']
pw_count = data["battery_count"]
if args.debug or not args.nonverbose:
print(f"READ: Current Operational Mode: {mode} with {pw_count} Powerwalls")
Expand Down

0 comments on commit 22526d0

Please sign in to comment.