Added errorhandling for rendering
This commit is contained in:
parent
b471d9cab8
commit
22646244ed
|
@ -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' : [
|
||||
|
|
10
update.py
10
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():
|
||||
|
|
Loading…
Reference in New Issue