add example code generator

This commit is contained in:
marys
2026-06-03 10:36:11 +02:00
parent b4ad1d2fd7
commit 03b5f3c2ea
17 changed files with 308 additions and 56 deletions
+18
View File
@@ -0,0 +1,18 @@
# 1
import paho.mqtt.client as mqtt
# 2
mqttBroker = "test.mosquitto.org"
class TemperatureServiceClient:
def __init__(self):
# 3
self.client = mqtt.Client()
# 4
self.client.connect(mqttBroker)
def sendTemperatureChange(self, id):
# 5
topic = "temperature/changed"
# 6
self.client.publish(topic, id)