comparison web/log.py @ 182:e731c0d30b09

set nearly working
author Matt Johnston <matt@ucc.asn.au>
date Tue, 04 Feb 2014 22:49:16 +0800
parents 30390852cb5d
children 177f616893e6
comparison
equal deleted inserted replaced
180:15ebb9de5049 182:e731c0d30b09
250 sensor_update(s, vs) 250 sensor_update(s, vs)
251 251
252 timedelta = time.time() - start_time 252 timedelta = time.time() - start_time
253 debugf.write("Updated sensors in %.2f secs\n" % timedelta) 253 debugf.write("Updated sensors in %.2f secs\n" % timedelta)
254 debugf.flush() 254 debugf.flush()
255
256 def get_params():
257 _FIELD_DEFAULTS = {
258 'fridge_setpoint': 16,
259 'fridge_difference': 0.2,
260 'overshoot_delay': 720, # 12 minutes
261 'overshoot_factor': 1, # ÂșC
262 'disabled': False,
263 'nowort': False,
264 'fridge_range_lower': 3,
265 'fridge_range_upper': 3,
266 }
267
268 r = []
269 for k, v in _FIELD_DEFAULTS.iteritems():
270 n = {'name': k, 'value': v}
271 if type(v) is bool:
272 if v:
273 n['value'] = "true"
274 kind = 'yesno'
275 else:
276 kind = 'number'
277 n['kind'] = kind
278 r.append(n)
279 return json.dumps(r, sort_keys=True, indent=4)