fix warning in Hass:
MQTT entity name starts with the device name in your config
This commit is contained in:
parent
42d3b5dc4c
commit
ffe4b91ac6
@ -54,12 +54,12 @@ namespace Mqtt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Ha::Sensor* sensors[] = {
|
Ha::Sensor* sensors[] = {
|
||||||
new Ha::TemperatureSensor{"Living room Temperature", "temperature"},
|
new Ha::TemperatureSensor{"Temperature", "temperature"},
|
||||||
new Ha::PressureSensor{"Living room Pressure", "pressure"},
|
new Ha::PressureSensor{"Pressure", "pressure"},
|
||||||
new Ha::AltitudeSensor{"Living room Altitude", "altitude"}
|
new Ha::AltitudeSensor{"Altitude", "altitude"}
|
||||||
};
|
};
|
||||||
|
|
||||||
Ha::Command* ledMqtt = (new Ha::Switch{"ESP Clock Led", "led",
|
Ha::Command* ledMqtt = (new Ha::Switch{"Led", "led",
|
||||||
[](const char* msg) {
|
[](const char* msg) {
|
||||||
String{ "ON" }.equals(msg) ? digitalWrite(LED_BUILTIN, LOW) : digitalWrite(LED_BUILTIN, HIGH);
|
String{ "ON" }.equals(msg) ? digitalWrite(LED_BUILTIN, LOW) : digitalWrite(LED_BUILTIN, HIGH);
|
||||||
},
|
},
|
||||||
@ -68,7 +68,7 @@ namespace Mqtt {
|
|||||||
}
|
}
|
||||||
})->withStateTopic();
|
})->withStateTopic();
|
||||||
|
|
||||||
Ha::Command* brightnessMqtt = (new Ha::Brightness{ "ESP Clock Brightness", "brightness",
|
Ha::Command* brightnessMqtt = (new Ha::Brightness{ "Brightness", "brightness",
|
||||||
[](const char* msg) {
|
[](const char* msg) {
|
||||||
Display::Brightness::set(String{ msg }.toInt());
|
Display::Brightness::set(String{ msg }.toInt());
|
||||||
},
|
},
|
||||||
@ -79,7 +79,7 @@ namespace Mqtt {
|
|||||||
}
|
}
|
||||||
})->withStateTopic();
|
})->withStateTopic();
|
||||||
|
|
||||||
Ha::Command* hourFormatMqtt = (new Ha::Switch{"ESP Clock Format 24h", "format_24h",
|
Ha::Command* hourFormatMqtt = (new Ha::Switch{"Format 24h", "format_24h",
|
||||||
[](const char* msg) {
|
[](const char* msg) {
|
||||||
String{ "ON" }.equals(msg) ? Display::changeHourFormat24(true) : Display::changeHourFormat24(false);
|
String{ "ON" }.equals(msg) ? Display::changeHourFormat24(true) : Display::changeHourFormat24(false);
|
||||||
},
|
},
|
||||||
@ -89,7 +89,7 @@ namespace Mqtt {
|
|||||||
})->withStateTopic();
|
})->withStateTopic();
|
||||||
|
|
||||||
Ha::Command* switches[] = {
|
Ha::Command* switches[] = {
|
||||||
new Ha::Button{"ESP Clock Restart", "restart",
|
new Ha::Button{"Restart", "restart",
|
||||||
[](const char* msg) {
|
[](const char* msg) {
|
||||||
if (String { "PRESS" }.equals(msg)) ESP.restart();
|
if (String { "PRESS" }.equals(msg)) ESP.restart();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user