diff options
author | Guido Günther <agx@sigxcpu.org> | 2013-12-04 20:46:54 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2013-12-04 22:12:20 +0100 |
commit | 0878bcf1e41c747ae24c820c471065491feaca80 (patch) | |
tree | 1ccc3d915a9753bcb7d373b8b0b1ea599787bf75 /pellematic-temp | |
parent | 156503bebddf753662c3d6e15cc8f2695252e54e (diff) |
Fix preset value detection
Diffstat (limited to 'pellematic-temp')
-rwxr-xr-x | pellematic-temp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/pellematic-temp b/pellematic-temp index d61b365..f27cf39 100755 --- a/pellematic-temp +++ b/pellematic-temp @@ -85,6 +85,20 @@ def fixup(name): def canon(name): return re.sub(r"[^a-zA-Z0-9_]", "_", name) +def is_preset(name): + """ + Preset values are inconsistently named so return + so we have to decide manually. + """ + if name.endswith(' Set'): + return True + elif ' Limit ' in name: + return True + elif name == 'Room Temp Heating': + return True + else: + return False + def print_config(url): print """graph_title Pellematic Temperature values graph_vlabel Temperature in Degree Celsius @@ -97,7 +111,7 @@ graph_info This graph shows different temperture values as displayed by a Pellet name = fixup(item['shortText']) print "%s.label %s" % (canon(name), name) print "%s.type GAUGE" % canon(name) - thickness = 1 if name.endswith(' Set') else 2 + thickness = 1 if is_preset(name) else 2 print "%s.draw LINE%d" % (canon(name), thickness) def degree_celsius(val): |