Add doorrouter
This commit is contained in:
18
app/services/door.py
Normal file
18
app/services/door.py
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
import paho.mqtt.client as mqttClient
|
||||
|
||||
doorIsOpen = True
|
||||
client = mqttClient.Client(client_id="", userdata=None, protocol=mqttClient.MQTTv5)
|
||||
client.tls_set(tls_version=mqttClient.ssl.PROTOCOL_TLS)
|
||||
client.username_pw_set("username", "passwort")
|
||||
#client.connect("host", port=8883)
|
||||
|
||||
def opendoor():
|
||||
doorIsOpen = True
|
||||
publish.single(topic="/lock/action", payload="unlock")
|
||||
pass
|
||||
|
||||
def closedoor():
|
||||
doorIsOpen = False
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user