Commit 8d99e244 authored by Peter-Bernd Otte's avatar Peter-Bernd Otte

camelCase for luxThreshold

parent fa34e222
......@@ -16,7 +16,7 @@ testraum/testrelais:
toggleTopics: homie/enocean/test/schalter2
inverseSwitchOnTopics: homie/enocean/test/schalter6
prolongateStateTopics: homie/enocean/test/schalter5
luxthreshold: 200 #below this threshold, lights get switched on. Default=100
luxThreshold: 200 #below this threshold, lights get switched on. Default=100
MQTTRelaisTopic: homie/fsr-ww/3
......@@ -123,11 +123,11 @@ for section in cfg:
if x.MQTTRelaisTopic == cfg[section]["MQTTRelaisTopic"]:
logger.error("MQTTRelaisTopic: "+str(cfg[section]["MQTTRelaisTopic"])+" does already exist. Will not be added.")
luxthreshold = 100
if "luxthreshold" in cfg[section]:
luxthreshold = cfg[section]["luxthreshold"]
if type(luxthreshold) is not int: luxthreshold = 100
logger.debug("luxthreshold used: "+str(luxthreshold))
luxThreshold = 100
if "luxThreshold" in cfg[section]:
luxThreshold = cfg[section]["luxThreshold"]
if type(luxThreshold) is not int: luxThreshold = 100
logger.debug("luxThreshold used: "+str(luxThreshold))
defaultTopics = cfg[section]["defaultTopics"] if "defaultTopics" in cfg[section] and isinstance(cfg[section]["defaultTopics"],(list, str)) else []
toggleTopics = cfg[section]["toggleTopics"] if "toggleTopics" in cfg[section] and isinstance(cfg[section]["toggleTopics"],(list, str)) else []
......@@ -152,7 +152,7 @@ for section in cfg:
defaultTopics=defaultTopics, inverseSwitchOnTopics=inverseSwitchOnTopics,
defaultSwitchOffTime=defaultSwitchOffTime, debug=debugItem, relaisType=relaisType, luxthreshold=luxthreshold))
defaultSwitchOffTime=defaultSwitchOffTime, debug=debugItem, relaisType=relaisType, luxThreshold=luxThreshold))"Adding successfully.")
......@@ -22,11 +22,11 @@ class rLightDesire(Enum):
class relais:
def __init__(self, MQTTClient, MQTTName, MQTTRelaisTopic, defaultTopics=None, toggleTopics=None, dimmTopics=None,
inverseSwitchOnTopics=None, prolongateStateTopics=None, defaultSwitchOffTime=None, debug=False, relaisType="relais", luxthreshold=100):
inverseSwitchOnTopics=None, prolongateStateTopics=None, defaultSwitchOffTime=None, debug=False, relaisType="relais", luxThreshold=100):
self.MQTTname = MQTTName #string
self.type = relaisType # possible: "relais" and "dimmer"
self.debug = debug
self.luxthreshold = luxthreshold #below this threshold in lux the PIR switches on
self.luxThreshold = luxThreshold #below this threshold in lux the PIR switches on
self.MQTTClient = MQTTClient #object
self.MQTTRelaisTopic = MQTTRelaisTopic #string
......@@ -89,7 +89,7 @@ class relais:
self.timeLastStateConfirm = time.time()
if self.debug: print(self.MQTTname, "Check Motion Sensors")
lux = msg['lux'] if 'lux' in msg else 100
if msg['v'] > 0 and self.luxthreshold > lux:
if msg['v'] > 0 and self.luxThreshold > lux:
self.lightdesire = rLightDesire.lockedDueToPIR
self.setV(1, reason="PIR motion")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment