Added mqtt namr
This commit is contained in:
@@ -182,6 +182,7 @@ void setup() {
|
||||
mqttClient.onMessage(onMqttMessage);
|
||||
mqttClient.onPublish(onMqttPublish);
|
||||
mqttClient.setServer(mqtt_server, 1883);
|
||||
mqttClient.setClientId("SW_Koridor");
|
||||
|
||||
button.attachClick(oneClick);
|
||||
button.attachLongPressStart(longPress);
|
||||
@@ -204,5 +205,11 @@ void loop() {
|
||||
EEPROM.put(0, lStat1);
|
||||
EEPROM.commit();
|
||||
}
|
||||
if (cRun + 9999 < millis()){
|
||||
cRun = millis();
|
||||
char v[11];
|
||||
itoa(cRun, v, 10);
|
||||
mqttClient.publish("/home/kor/millislamp", 0, false, v);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user