Ejemplo n.º 1
0
 def on_connect(self, client: mqtt.Client, userdata, flags, rc):
     # Extend the on_connect method of SIISThing
     SIISThing.on_connect(self, client, userdata, flags, rc)
     self.client.publish(self.state_topic,
                         payload=self.last_state,
                         qos=1,
                         retain=True)
Ejemplo n.º 2
0
 def on_connect(self, client: mqtt.Client, userdata, flags, rc) -> None:
     SIISThing.on_connect(self, client, userdata, flags, rc)
     client.publish(self.temp_state_topic,
                    payload=self.get_temp(),
                    qos=1,
                    retain=True)
     client.publish(self.humidity_state_topic,
                    payload=self.get_humidity(),
                    qos=1,
                    retain=True)
     client.publish(self.pressure_state_topic,
                    payload=self.get_pressure(),
                    qos=1,
                    retain=True)
Ejemplo n.º 3
0
 def on_connect(self, client: mqtt.Client, userdata, flags, rc):
     SIISThing.on_connect(self, client, userdata, flags, rc)
     client.publish(self.state_topic,
                    payload=self.last_state,
                    qos=1,
                    retain=True)
Ejemplo n.º 4
0
 def on_connect(self, client: mqtt.Client, userdata, flags, rc):
     SIISThing.on_connect(self, client, userdata, flags, rc)
     current_state: str = json.dumps(self.last_state)
     self.client.publish(self.state_topic, current_state, qos=1, retain=True)
Ejemplo n.º 5
0
 def on_connect(self, client: mqtt.Client, userdata, flags, rc):
     "MQTT callback for when the client connects to the broker"
     SIISThing.on_connect(self, client, userdata, flags, rc)
     self.client.subscribe(self.mode_set_topic)
     self.client.subscribe(self.target_temperature_set)
     self.client.subscribe(self.scheduler_topic)