Skip to content

Commit

Permalink
Fix for Tesla API change #50
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonacox committed Oct 8, 2023
1 parent 04aeda7 commit d9a8278
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tools/set-reserve.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
Usage:
* Install the required python modules:
pip install python-dateutil teslapy
pip install python-dateutil
pip install -e git+https://github.com/tdorssers/TeslaPy.git#egg=teslapy
* To use this script:
Expand Down Expand Up @@ -260,7 +261,7 @@ def get_level():
if args.debug:
print(f"Retrieving Powerwall battery level reserve setting...")

data = battery.get_battery_data()
data = battery.get_site_info()
if args.debug:
print(data)
return data
Expand Down Expand Up @@ -310,7 +311,7 @@ def set_level(level):
if args.read:
# Read and return current Powerwall battery level reserve setting
data = get_level()
level = data["backup"]["backup_reserve_percent"]
level = data["backup_reserve_percent"]
pw_count = data["battery_count"]
if args.debug or not args.number:
print(f"READ: Current Battery Reserve Setting: {level}% for {pw_count} Powerwalls")
Expand Down

0 comments on commit d9a8278

Please sign in to comment.