From 63dbf78594951115b31cb88a202182c8f3e7e242 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Sat, 22 Nov 2014 18:45:47 +0100 Subject: Sort fields alphabetically --- pellematic-temp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'pellematic-temp') 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']) -- cgit v1.2.3