diff pw2log.py @ 4:8990981c60a0

Catch up with tesla_powerwall API changes.
author Daniel O'Connor <darius@dons.net.au>
date Mon, 04 Jul 2022 12:09:29 +0930
parents ec3c8b63d8e7
children
line wrap: on
line diff
--- a/pw2log.py	Tue Feb 09 22:10:25 2021 +1030
+++ b/pw2log.py	Mon Jul 04 12:09:29 2022 +0930
@@ -111,17 +111,16 @@
             if not pw:
                 first = True
                 pw = Powerwall(pwip)
-                pw.login(username, password)
-                pw.detect_and_pin_version()
+                pw.login(password, username)
             meters = pw.get_meters()
-            grid_volts = meters.site.avarage_voltage
+            grid_volts = meters.site.average_voltage
             grid_freq = meters.site.frequency
             grid_power = meters.site.instant_power
             load_power = meters.load.instant_power
             battery_power = meters.battery.instant_power
             solar_power = meters.solar.instant_power
             charge = pw.get_charge()
-        except APIError as e:
+        except Exception as e:
             pw = None
             logger.error('Error communicating with Powerwall: ' + str(e))
             time.sleep(300)