diff options
author | Guido Günther <agx@sigxcpu.org> | 2014-11-22 18:45:47 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2014-11-22 18:45:47 +0100 |
commit | 63dbf78594951115b31cb88a202182c8f3e7e242 (patch) | |
tree | ea6fee55dba8a4ab18baad4e3f1476941a7f7d53 /pellematic-temp | |
parent | 7cde77e2e212e4d786cd190b760d3dd5332bec1f (diff) |
Sort fields alphabetically
Diffstat (limited to 'pellematic-temp')
-rwxr-xr-x | pellematic-temp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/pellematic-temp b/pellematic-temp index c3b84b5..cdc5aa2 100755 --- a/pellematic-temp +++ b/pellematic-temp @@ -114,13 +114,16 @@ graph_category Heating graph_info This graph shows different temperture values as displayed by a Pelletronic Touch 2.0 by Ökofen""" out = fetch_raw(url) + names = [] for item in out: if item['name'] in items.keys(): - name = items[item['name']] - print "%s.label %s" % (canon(name), name) - print "%s.type GAUGE" % canon(name) - thickness = 1 if is_preset(name) else 2 - print "%s.draw LINE%d" % (canon(name), thickness) + names.append(items[item['name']]) + + for name in sorted(names): + print "%s.label %s" % (canon(name), name) + print "%s.type GAUGE" % canon(name) + thickness = 1 if is_preset(name) else 2 + print "%s.draw LINE%d" % (canon(name), thickness) def degree_celsius(val): return float(int(val['value'])) / float(val['divisor']) |