19 lines
438 B
Python
19 lines
438 B
Python
|
|
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
|
|
|