added config prefix

This commit is contained in:
Senad Uka
2016-01-24 09:18:14 +01:00
parent f7061ab3da
commit d0657960f4
3 changed files with 8 additions and 8 deletions

View File

@@ -1,8 +1,8 @@
import config
def sync():
server = Server(API_BASE_URL, CONTROLLER_ID)
local = File(STATE_FILE)
server = Server(config.API_BASE_URL, config.CONTROLLER_ID)
local = File(config.STATE_FILE)
server_state = server.get_state()
if local.present():

View File

@@ -7,7 +7,7 @@ class Changer(object):
self.local_state = local_state
self.remote_state = remote_state
GPIO.setmode(GPIO.BCM) # Broadcom pin-numbering scheme
GPIO.setup(GPIO_PIN_VALVE, GPIO.OUT)
GPIO.setup(config.GPIO_PIN_VALVE, GPIO.OUT)
self.states = {
'opening': self.open_valve,
@@ -26,11 +26,11 @@ class Changer(object):
return self.local_state
def open_valve():
GPIO.output(GPIO_PIN_VALVE, GPIO.HIGH)
GPIO.output(config.GPIO_PIN_VALVE, GPIO.HIGH)
self.local_state['out_valve'] = 'open'
def close_valve():
GPIO.output(GPIO_PIN_VALVE, GPIO.LOW)
GPIO.output(config.GPIO_PIN_VALVE, GPIO.LOW)
self.local_state['out_valve'] = 'closed'
def validate_states(self):