Mercurial > templog
annotate py/config.py @ 253:0a1b642e3086
long polling config updates
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Mon, 08 Jun 2015 22:29:46 +0800 |
parents | d9e81a563923 |
children | 26eee8591f61 |
rev | line source |
---|---|
162
d73077e8cd67
Add daemon mode with locking, add "disabled" parameter
Matt Johnston <matt@ucc.asn.au>
parents:
160
diff
changeset
|
1 import os.path |
148 | 2 |
220
251524081924
make the fridge off timer more robust
Matt Johnston <matt@ucc.asn.au>
parents:
176
diff
changeset
|
3 FRIDGE_SLEEP = 60 # this value works. may affect the algorithm |
251524081924
make the fridge off timer more robust
Matt Johnston <matt@ucc.asn.au>
parents:
176
diff
changeset
|
4 SENSOR_SLEEP = 15 # same for this. |
251524081924
make the fridge off timer more robust
Matt Johnston <matt@ucc.asn.au>
parents:
176
diff
changeset
|
5 UPLOAD_SLEEP = 83 # nice and prime |
148 | 6 |
220
251524081924
make the fridge off timer more robust
Matt Johnston <matt@ucc.asn.au>
parents:
176
diff
changeset
|
7 FRIDGE_DELAY = 600 # 10 mins, to avoid fridge damage from frequent cycling off/on |
149
d686b111dab4
working better. logging works properly, cleanup fridge.off() happens.
Matt Johnston <matt@ucc.asn.au>
parents:
148
diff
changeset
|
8 FRIDGE_WORT_INVALID_TIME = 300 # 5 mins |
145 | 9 |
220
251524081924
make the fridge off timer more robust
Matt Johnston <matt@ucc.asn.au>
parents:
176
diff
changeset
|
10 # 12 hours of "offline" readings stored |
160 | 11 MAX_READINGS = 12*60*60 / SENSOR_SLEEP |
12 | |
162
d73077e8cd67
Add daemon mode with locking, add "disabled" parameter
Matt Johnston <matt@ucc.asn.au>
parents:
160
diff
changeset
|
13 PARAMS_FILE = os.path.join(os.path.dirname(__file__), 'tempserver.conf') |
148 | 14 |
15 SENSOR_BASE_DIR = '/sys/devices/w1_bus_master1' | |
228 | 16 FRIDGE_GPIO_PIN = 17 |
153 | 17 WORT_NAME = '28-0000042cf4dd' |
18 FRIDGE_NAME = '28-0000042cccc4' | |
19 AMBIENT_NAME = '28-0000042c6dbb' | |
151
e114b38c8a55
internal temperature sensor
Matt Johnston <matt@ucc.asn.au>
parents:
149
diff
changeset
|
20 INTERNAL_TEMPERATURE = '/sys/class/thermal/thermal_zone0/temp' |
160 | 21 |
22 HMAC_KEY = "a key" | |
253
0a1b642e3086
long polling config updates
Matt Johnston <matt@ucc.asn.au>
parents:
228
diff
changeset
|
23 SERVER_URL = 'https://evil.ucc.asn.au/~matt/templog/update' |
0a1b642e3086
long polling config updates
Matt Johnston <matt@ucc.asn.au>
parents:
228
diff
changeset
|
24 UPDATE_URL = "%s/update" % SERVER_URL |
0a1b642e3086
long polling config updates
Matt Johnston <matt@ucc.asn.au>
parents:
228
diff
changeset
|
25 SETTINGS_URL = "%s/update" % SERVER_URL |
160 | 26 |
220
251524081924
make the fridge off timer more robust
Matt Johnston <matt@ucc.asn.au>
parents:
176
diff
changeset
|
27 # site-local values overridden in localconfig, eg WORT_NAME, HMAC_KEY |
160 | 28 try: |
29 from localconfig import * | |
30 except ImportError: | |
31 pass |