diff --git a/config.py b/config.py index 5203ba3..d9dd27a 100644 --- a/config.py +++ b/config.py @@ -43,7 +43,7 @@ GRAPHS = { GraphLine('I_pv_in', 'Strom PV [A]', '#ff0000'), GraphLine('I_load_total', 'Strom Last [A]', '#00ff00'), ], - 'realy' : [ + 'relay' : [ GraphLine('load_switch', 'Relay', '#0000ff'), ], 'charges' : [ diff --git a/update.py b/update.py index 943c450..3b1717d 100644 --- a/update.py +++ b/update.py @@ -84,7 +84,10 @@ def update_graphs(): graph_params += ['DEF:%s=%s:%s:LAST' % (name, DATA_FILE, name)] graph_params += ['LINE1:%s%s:%s' % (name, color, lable)] - rrdtool.graph(*graph_params) + try: + rrdtool.graph(*graph_params) + except rrdtool.OperationalError: + print("Failed to render current data") # Also render Archives graph_params = ['%s_archive.png' % graph_name, '-a', @@ -94,7 +97,10 @@ def update_graphs(): graph_params += ['DEF:%s=%s:%s:AVERAGE' % (name, DATA_FILE, name)] graph_params += ['LINE1:%s%s:%s' % (name, color, lable)] - rrdtool.graph(*graph_params) + try: + rrdtool.graph(*graph_params) + except rrdtool.OperationalError: + print("Failed to render archive data") def upload_graphs():