annotate py/config.py @ 477:d05b1612e19e

a few fixes
author Matt Johnston <matt@ucc.asn.au>
date Thu, 30 Jan 2014 22:55:27 +0800
parents 6af0dcc5da45
children 251524081924
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
459
c34083c078db uploader works
Matt Johnston <matt@ucc.asn.au>
parents: 452
diff changeset
3 FRIDGE_SLEEP = 60
448
fe729664a5e6 working better. logging works properly, cleanup fridge.off() happens.
Matt Johnston <matt@ucc.asn.au>
parents: 447
diff changeset
4 SENSOR_SLEEP = 15
459
c34083c078db uploader works
Matt Johnston <matt@ucc.asn.au>
parents: 452
diff changeset
5 UPLOAD_SLEEP = 80
447
8fdf86ea41e7 few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents: 444
diff changeset
6
459
c34083c078db uploader works
Matt Johnston <matt@ucc.asn.au>
parents: 452
diff changeset
7 FRIDGE_DELAY = 600 # 10 mins
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
459
c34083c078db uploader works
Matt Johnston <matt@ucc.asn.au>
parents: 452
diff changeset
10 # 12 hours
c34083c078db uploader works
Matt Johnston <matt@ucc.asn.au>
parents: 452
diff changeset
11 MAX_READINGS = 12*60*60 / SENSOR_SLEEP
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
8fdf86ea41e7 few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents: 444
diff changeset
15 SENSOR_BASE_DIR = '/sys/devices/w1_bus_master1'
448
fe729664a5e6 working better. logging works properly, cleanup fridge.off() happens.
Matt Johnston <matt@ucc.asn.au>
parents: 447
diff changeset
16 FRIDGE_GPIO = '/sys/devices/virtual/gpio/gpio17'
452
25bdf95f0e29 config for sensor IDs
Matt Johnston <matt@ucc.asn.au>
parents: 449
diff changeset
17 WORT_NAME = '28-0000042cf4dd'
25bdf95f0e29 config for sensor IDs
Matt Johnston <matt@ucc.asn.au>
parents: 449
diff changeset
18 FRIDGE_NAME = '28-0000042cccc4'
25bdf95f0e29 config for sensor IDs
Matt Johnston <matt@ucc.asn.au>
parents: 449
diff changeset
19 AMBIENT_NAME = '28-0000042c6dbb'
449
e99559bf188f internal temperature sensor
Matt Johnston <matt@ucc.asn.au>
parents: 448
diff changeset
20 INTERNAL_TEMPERATURE = '/sys/class/thermal/thermal_zone0/temp'
459
c34083c078db uploader works
Matt Johnston <matt@ucc.asn.au>
parents: 452
diff changeset
21
c34083c078db uploader works
Matt Johnston <matt@ucc.asn.au>
parents: 452
diff changeset
22 HMAC_KEY = "a key"
475
6af0dcc5da45 back to evil URL
Matt Johnston <matt@ucc.asn.au>
parents: 461
diff changeset
23 #UPDATE_URL = 'https://matt.ucc.asn.au/test/templog/update'
6af0dcc5da45 back to evil URL
Matt Johnston <matt@ucc.asn.au>
parents: 461
diff changeset
24 UPDATE_URL = 'https://evil.ucc.asn.au/~matt/templog/update'
459
c34083c078db uploader works
Matt Johnston <matt@ucc.asn.au>
parents: 452
diff changeset
25
c34083c078db uploader works
Matt Johnston <matt@ucc.asn.au>
parents: 452
diff changeset
26 try:
c34083c078db uploader works
Matt Johnston <matt@ucc.asn.au>
parents: 452
diff changeset
27 from localconfig import *
c34083c078db uploader works
Matt Johnston <matt@ucc.asn.au>
parents: 452
diff changeset
28 except ImportError:
c34083c078db uploader works
Matt Johnston <matt@ucc.asn.au>
parents: 452
diff changeset
29 pass