config values

This commit is contained in:
tkl 2016-12-25 10:03:58 +01:00 committed by Thomas Klaehn
parent 745315020b
commit 90cf74e0a2

View File

@ -19,7 +19,7 @@ STATE_ERROR = "error"
LIGHT_READ_DELAY_S = 30 LIGHT_READ_DELAY_S = 30
LIGHT_CONSECUTIVE_READS = 10 LIGHT_CONSECUTIVE_READS = 10
LIGHT_LX_THRESHOLD = {"open":10, "close":0} LIGHT_LX_THRESHOLD = {"open":5, "close":0}
MQTT_HOST = "gitlab" MQTT_HOST = "gitlab"
MQTT_TOPIC = "outdoor/chickenhouse/gate" MQTT_TOPIC = "outdoor/chickenhouse/gate"
@ -32,7 +32,7 @@ POWER_SENSOR_I2C_ADDRESS = 0x40
CONSECUTIVE_CURRENT_READS = 1000 CONSECUTIVE_CURRENT_READS = 1000
MAX_ENGINE_POWER = {"up":330, "down":300} MAX_ENGINE_POWER = {"up":330, "down":300}
MAX_GATE_RUNTIME = {"open":250, "close":250} MAX_GATE_RUNTIME = {"open":270, "close":250}
class GateState(object): class GateState(object):
@ -92,7 +92,7 @@ class GateState(object):
next_state = self.__next_state next_state = self.__next_state
if self.__is_transition(): if self.__is_transition():
self.__gate_handler.close() self.__gate_handler.close()
sleep(2) sleep(5)
self.__gate_handler.stop() self.__gate_handler.stop()
self.__comserver.transmit(MQTT_TOPIC, str(time()) + " Opened " + \ self.__comserver.transmit(MQTT_TOPIC, str(time()) + " Opened " + \
str(self.__power_data.average()) + " mW") str(self.__power_data.average()) + " mW")
@ -108,7 +108,7 @@ class GateState(object):
next_state = self.__next_state next_state = self.__next_state
if self.__is_transition(): if self.__is_transition():
self.__gate_handler.open() self.__gate_handler.open()
sleep(2) sleep(5)
self.__gate_handler.stop() self.__gate_handler.stop()
self.__comserver.transmit(MQTT_TOPIC, str(time()) + " Closed " + \ self.__comserver.transmit(MQTT_TOPIC, str(time()) + " Closed " + \
str(self.__power_data.average()) + " mW") str(self.__power_data.average()) + " mW")