Added a TimeEffect to show a countdown to a time given via MQTT.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@ -50,6 +50,10 @@ void mqtt_callback(char* original_topic, byte* pl, unsigned int length) {
|
||||
LOGln("Set weather_temperatures[%d] to value %d", id, val);
|
||||
}
|
||||
return;
|
||||
} else if (topic.equals(MQTT_TOPIC_TIMER)) {
|
||||
timer = payload.toInt();
|
||||
LOGln("Set timer to %lu.", timer);
|
||||
return;
|
||||
}
|
||||
|
||||
topic.remove(0, strlen(MQTT_TOPIC)); // Strip MQTT_TOPIC from the beginning
|
||||
@ -102,6 +106,7 @@ boolean mqtt_connect() {
|
||||
mqtt_client.publish(MQTT_TOPIC "status", buffer, true);
|
||||
mqtt_client.subscribe(MQTT_TOPIC "+");
|
||||
mqtt_client.subscribe(MQTT_TOPIC_WEATHER "#");
|
||||
mqtt_client.subscribe(MQTT_TOPIC_TIMER);
|
||||
}
|
||||
return mqtt_client.connected();
|
||||
}
|
||||
|
Reference in New Issue
Block a user