jasonacox / pypowerwall

Python API for Tesla Powerwall and Solar Power Data
MIT License
120 stars 21 forks source link

V0.10.1 - TEDAPI Vitals Hotfix #96

Closed jasonacox closed 4 weeks ago

jasonacox commented 1 month ago

Minor Updates / Fixes

jasonacox commented 1 month ago

Error raised by @aristobrat

https://github.com/jasonacox/Powerwall-Dashboard/discussions/392#discussioncomment-9709840

06/07/2024 11:30:10 PM [proxy] [INFO] pyPowerwall [0.10.1] Proxy Server [t58] - HTTP Port 8675
06/07/2024 11:30:10 PM [proxy] [INFO] pyPowerwall Proxy Started
06/07/2024 11:30:11 PM [proxy] [INFO] pyPowerwall Proxy Server - Local Mode
06/07/2024 11:30:11 PM [proxy] [INFO] Connected to Energy Gateway 192.168.91.1 (My Home)
06/07/2024 11:30:11 PM [proxy] [INFO] TEDAPI Mode Enabled for Device Vitals
----------------------------------------
Exception occurred during processing of request from ('172.19.0.5', 47506)
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/socketserver.py", line 683, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/local/lib/python3.10/socketserver.py", line 360, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/local/lib/python3.10/socketserver.py", line 747, in __init__
    self.handle()
  File "/usr/local/lib/python3.10/http/server.py", line 433, in handle
    self.handle_one_request()
  File "/usr/local/lib/python3.10/http/server.py", line 421, in handle_one_request
    method()
  File "/app/server.py", line 345, in do_GET
    message: str = pw.strings(jsonformat=True) or json.dumps({})
  File "/app/pypowerwall/__init__.py", line 375, in strings
    v: dict = self.vitals() or {}
  File "/app/pypowerwall/__init__.py", line 355, in vitals
    output = self.client.vitals()
  File "/app/pypowerwall/local/pypowerwall_local.py", line 354, in vitals
    return self.tedapi.vitals()
  File "/app/pypowerwall/tedapi/__init__.py", line 501, in vitals
    tesla_nameplate = config['solars'][i].get('power_rating_watts', None)
KeyError: 'solars'
----------------------------------------
jasonacox commented 1 month ago

Updated test proxy: jasonacox/pypowerwall:0.10.1t58-beta4