Beispiel #1
0
def _on_connect(client, userdata, flags, rc):
    
    if rc == 0:
        if len(userdata) > 0:
            _do_publish(client)
    else:
        raise mqtt.MQTTException(paho.connack_string(rc))
Beispiel #2
0
def _on_connect(c, userdata, flags, rc):
    """Internal callback"""
    if rc == 0:
        if len(userdata) > 0:
            _do_publish(c)
    else:
        raise mqtt.MQTTException(paho.connack_string(rc))
Beispiel #3
0
def _on_connect(client, userdata, flags, rc):
    """Internal callback"""
    #pylint: disable=invalid-name, unused-argument

    if rc == 0:
        if len(userdata) > 0:
            _do_publish(client)
    else:
        raise mqtt.MQTTException(paho.connack_string(rc))
Beispiel #4
0
def _on_connect(c, userdata, flags, rc):
    """Internal callback"""
    if rc != 0:
        raise mqtt.MQTTException(paho.connack_string(rc))

    if type(userdata['topics']) is list:
        for t in userdata['topics']:
            c.subscribe(t, userdata['qos'])
    else:
        c.subscribe(userdata['topics'], userdata['qos'])
def _on_connect(client, userdata, flags, rc):
    """Internal callback"""
    if rc != 0:
        raise mqtt.MQTTException(paho.connack_string(rc))

    if isinstance(userdata['topics'], list):
        for topic in userdata['topics']:
            client.subscribe(topic, userdata['qos'])
    else:
        client.subscribe(userdata['topics'], userdata['qos'])
Beispiel #6
0
 def _on_connect(self, client, userdata, flags, rc):
     if rc != 0:
         raise mqtt.MQTTException(mqtt.client.connack_string(rc))
Beispiel #7
0
def _on_connect(c, userdata, flags, rc):
    """Internal callback"""
    if rc != 0:
        raise mqtt.MQTTException(paho.connack_string(rc))