- moves transistion time and app time setting into onscreen-menu
- Text starts to scroll on the left side instead from right
- allows to switch to a page by name via mqtt
- custompages doesnt need to have integers as an id anymore, you can also use strings now.

closes #7
closes #4
This commit is contained in:
Stephan Mühl
2023-03-23 14:06:11 +01:00
parent ec613ec43e
commit 7b5a4d3aba
14 changed files with 324 additions and 190 deletions

View File

@@ -132,6 +132,12 @@ void onMqttMessage(const char *topic, const uint8_t *payload, uint16_t length)
return;
}
if (strTopic == MQTT_PREFIX + "/switch")
{
DisplayManager.switchToApp(strPayload);
return;
}
else if (strTopic.startsWith(MQTT_PREFIX + "/custom"))
{
String topic_str = topic;
@@ -140,8 +146,8 @@ void onMqttMessage(const char *topic, const uint8_t *payload, uint16_t length)
{
topic_str = topic_str.substring(prefix.length());
}
uint16_t id = topic_str.toInt();
DisplayManager.generateCustomPage(id, strPayload);
DisplayManager.generateCustomPage(topic_str, strPayload);
return;
}
}
@@ -154,6 +160,7 @@ void onMqttConnected()
mqtt.subscribe((prefix + String("/notify")).c_str());
mqtt.subscribe((prefix + String("/timer")).c_str());
mqtt.subscribe((prefix + String("/custom/#")).c_str());
mqtt.subscribe((prefix + String("/switch")).c_str());
Serial.println("MQTT Connected");
}