publish led state at startup
This commit is contained in:
parent
22544c225a
commit
f1d41ade51
@ -109,6 +109,10 @@ namespace Mqtt {
|
|||||||
if (client.connected()) publish(hourFormatMqtt->stateTopic, format24 ? "ON" : "OFF");
|
if (client.connected()) publish(hourFormatMqtt->stateTopic, format24 ? "ON" : "OFF");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void publishLedState() {
|
||||||
|
Mqtt::publish(Mqtt::ledMqtt->stateTopic, digitalRead(LED_BUILTIN) ? "OFF" : "ON");
|
||||||
|
}
|
||||||
|
|
||||||
void publishConfig() {
|
void publishConfig() {
|
||||||
for (Ha::Component* cmp : sensors) {
|
for (Ha::Component* cmp : sensors) {
|
||||||
publishComponentConfig(*cmp);
|
publishComponentConfig(*cmp);
|
||||||
|
|||||||
@ -25,7 +25,7 @@ Task tButton(TASK_IMMEDIATE, TASK_ONCE, []() {
|
|||||||
Display::displayTemp(Bmp::data.readTemp());
|
Display::displayTemp(Bmp::data.readTemp());
|
||||||
}, &ts);
|
}, &ts);
|
||||||
Task tLed(TASK_IMMEDIATE, TASK_ONCE, []() {
|
Task tLed(TASK_IMMEDIATE, TASK_ONCE, []() {
|
||||||
Mqtt::publish(Mqtt::ledMqtt->stateTopic, digitalRead(LED_BUILTIN) ? "OFF" : "ON");
|
Mqtt::publishLedState();
|
||||||
}, &ts);
|
}, &ts);
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user