Skip to content
Permalink
51ff405960
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
13 lines (10 sloc) 423 Bytes
from flask_mqtt import Mqtt # MQTT using flask
from app.mqtt import mqtt_message_handler
def init_app(app):
mqtt = Mqtt(app)
@mqtt.on_connect()
def handle_connect(client, userdata, flags, rc):
mqtt.subscribe('owntracks/4009user/#') #owntracks subscribing to mqtt
@mqtt.on_message()
def handle_mqtt_message(client, userdata, msg):
mqtt_message_handler.getMsg(msg)