fix: setpoint clamp, thread safety, error handling, real-time kWh counters; cleanup repo
This commit is contained in:
+6
-3
@@ -51,13 +51,13 @@ mqtt = mqtthandler.handler(cm)
|
||||
if 'battery_total' in config:
|
||||
try:
|
||||
cm.set_battery_total_net_delivery(float(config['battery_total']['net_delivery']))
|
||||
except:
|
||||
except Exception:
|
||||
logger.error("Unable to load net_delivery {}".format(config['battery_total']['net_delivery']))
|
||||
exit()
|
||||
|
||||
try:
|
||||
cm.set_battery_total_net_usage(float(config['battery_total']['net_usage']))
|
||||
except:
|
||||
except Exception:
|
||||
logger.error("Unable to load net_usage {}".format(config['battery_total']['net_usage']))
|
||||
exit()
|
||||
|
||||
@@ -113,7 +113,10 @@ def update():
|
||||
|
||||
def main():
|
||||
while True:
|
||||
update()
|
||||
try:
|
||||
update()
|
||||
except Exception:
|
||||
logger.exception("Update failed, retrying next cycle")
|
||||
time.sleep(10)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user