Installation Software-Update am 24.06.2021 zwischen 21:00 und 23:00 Uhr: wird dafür kurzzeitig nicht zur Verfügung stehen.

Commit faffce95 authored by Peter-Bernd Otte's avatar Peter-Bernd Otte
Browse files

added relais type

parent e8717535
......@@ -112,6 +112,10 @@ for section in cfg:
MQTTName="homie/"+args.mqtt_client_name+"/"+section"Adding Relais with MQTT topic: "+MQTTName)"Configuration: "+str(cfg[section]))
relaisType = "relais"
if "type" in cfg[section]:
if cfg[section]["type"] == "dimmer":
relaisType = "dimmer"
if "MQTTRelaisTopic" not in cfg[section]:
logger.error("MQTTRelaisTopic property is missing. Will not be added.")
......@@ -143,7 +147,7 @@ for section in cfg:
defaultTopics=defaultTopics, inverseSwitchOnTopics=inverseSwitchOnTopics,
defaultSwitchOffTime=defaultSwitchOffTime, debug=debugItem))
defaultSwitchOffTime=defaultSwitchOffTime, debug=debugItem, relaisType=relaisType))"Adding successfully.")
......@@ -22,9 +22,9 @@ 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):
inverseSwitchOnTopics=None, prolongateStateTopics=None, defaultSwitchOffTime=None, debug=False, relaisType="relais"):
self.MQTTname = MQTTName #string
self.type = "relais"
self.type = relaisType # possible: "relais" and "dimmer"
self.debug = debug
self.MQTTClient = MQTTClient #object
self.MQTTRelaisTopic = MQTTRelaisTopic #string
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