annotate py/config.py @ 576:ecec38cbad33

w1 master dir moved with my new sensor
author Matt Johnston <matt@ucc.asn.au>
date Tue, 17 Nov 2015 22:25:02 +0800
parents 26f20cee71be
children d3ebdb1d6a55
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
461
1eb68df9f8ab Add daemon mode with locking, add "disabled" parameter
Matt Johnston <matt@ucc.asn.au>
parents: 459
diff changeset
1 import os.path
447
8fdf86ea41e7 few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents: 444
diff changeset
2
519
838e868a046e make the fridge off timer more robust
Matt Johnston <matt@ucc.asn.au>
parents: 475
diff changeset
3 FRIDGE_SLEEP = 60 # this value works. may affect the algorithm
838e868a046e make the fridge off timer more robust
Matt Johnston <matt@ucc.asn.au>
parents: 475
diff changeset
4 SENSOR_SLEEP = 15 # same for this.
838e868a046e make the fridge off timer more robust
Matt Johnston <matt@ucc.asn.au>
parents: 475
diff changeset
5 UPLOAD_SLEEP = 83 # nice and prime
447
8fdf86ea41e7 few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents: 444
diff changeset
6
519
838e868a046e make the fridge off timer more robust
Matt Johnston <matt@ucc.asn.au>
parents: 475
diff changeset
7 FRIDGE_DELAY = 600 # 10 mins, to avoid fridge damage from frequent cycling off/on
448
fe729664a5e6 working better. logging works properly, cleanup fridge.off() happens.
Matt Johnston <matt@ucc.asn.au>
parents: 447
diff changeset
8 FRIDGE_WORT_INVALID_TIME = 300 # 5 mins
444
c5629d79b4ac few more bits
Matt Johnston <matt@ucc.asn.au>
parents: 443
diff changeset
9
519
838e868a046e make the fridge off timer more robust
Matt Johnston <matt@ucc.asn.au>
parents: 475
diff changeset
10 # 12 hours of "offline" readings stored
563
dd809548424c integer division
Matt Johnston <matt@ucc.asn.au>
parents: 556
diff changeset
11 MAX_READINGS = 12*60*60 // SENSOR_SLEEP
459
c34083c078db uploader works
Matt Johnston <matt@ucc.asn.au>
parents: 452
diff changeset
12
461
1eb68df9f8ab Add daemon mode with locking, add "disabled" parameter
Matt Johnston <matt@ucc.asn.au>
parents: 459
diff changeset
13 PARAMS_FILE = os.path.join(os.path.dirname(__file__), 'tempserver.conf')
447
8fdf86ea41e7 few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents: 444
diff changeset
14
576
ecec38cbad33 w1 master dir moved with my new sensor
Matt Johnston <matt@ucc.asn.au>
parents: 565
diff changeset
15 SENSOR_BASE_DIR = '/sys/devices/w1_bus_master2'
527
dd8895652485 porting to asyncio
Matt Johnston <matt@ucc.asn.au>
parents: 519
diff changeset
16 FRIDGE_GPIO_PIN = 17
565
26f20cee71be emergency change sensor config
Matt Johnston <matt@ucc.asn.au>
parents: 563
diff changeset
17 #WORT_NAME = '28-0000042cf4dd'
26f20cee71be emergency change sensor config
Matt Johnston <matt@ucc.asn.au>
parents: 563
diff changeset
18 #FRIDGE_NAME = '28-0000042cccc4'
26f20cee71be emergency change sensor config
Matt Johnston <matt@ucc.asn.au>
parents: 563
diff changeset
19 #AMBIENT_NAME = '28-0000042c6dbb'
26f20cee71be emergency change sensor config
Matt Johnston <matt@ucc.asn.au>
parents: 563
diff changeset
20 AMBIENT_NAME = 'missingambient'
26f20cee71be emergency change sensor config
Matt Johnston <matt@ucc.asn.au>
parents: 563
diff changeset
21 FRIDGE_NAME = 'missingfridge'
26f20cee71be emergency change sensor config
Matt Johnston <matt@ucc.asn.au>
parents: 563
diff changeset
22 WORT_NAME = '28-0000042cccc4' # was fridge
449
e99559bf188f internal temperature sensor
Matt Johnston <matt@ucc.asn.au>
parents: 448
diff changeset
23 INTERNAL_TEMPERATURE = '/sys/class/thermal/thermal_zone0/temp'
459
c34083c078db uploader works
Matt Johnston <matt@ucc.asn.au>
parents: 452
diff changeset
24
c34083c078db uploader works
Matt Johnston <matt@ucc.asn.au>
parents: 452
diff changeset
25 HMAC_KEY = "a key"
556
c5f8375b12a2 long polling works
Matt Johnston <matt@ucc.asn.au>
parents: 551
diff changeset
26 SERVER_URL = 'https://evil.ucc.asn.au/~matt/templog'
551
9499bd2f344b long polling config updates
Matt Johnston <matt@ucc.asn.au>
parents: 527
diff changeset
27 UPDATE_URL = "%s/update" % SERVER_URL
556
c5f8375b12a2 long polling works
Matt Johnston <matt@ucc.asn.au>
parents: 551
diff changeset
28 SETTINGS_URL = "%s/get_settings" % SERVER_URL
459
c34083c078db uploader works
Matt Johnston <matt@ucc.asn.au>
parents: 452
diff changeset
29
519
838e868a046e make the fridge off timer more robust
Matt Johnston <matt@ucc.asn.au>
parents: 475
diff changeset
30 # site-local values overridden in localconfig, eg WORT_NAME, HMAC_KEY
459
c34083c078db uploader works
Matt Johnston <matt@ucc.asn.au>
parents: 452
diff changeset
31 try:
c34083c078db uploader works
Matt Johnston <matt@ucc.asn.au>
parents: 452
diff changeset
32 from localconfig import *
c34083c078db uploader works
Matt Johnston <matt@ucc.asn.au>
parents: 452
diff changeset
33 except ImportError:
c34083c078db uploader works
Matt Johnston <matt@ucc.asn.au>
parents: 452
diff changeset
34 pass