fix warning in Hass:

MQTT entity name starts with the device name in your config
This commit is contained in:
Nicu Hodos 2023-10-13 20:37:15 +02:00
parent 42d3b5dc4c
commit ffe4b91ac6

View File

@ -54,12 +54,12 @@ namespace Mqtt {
}
Ha::Sensor* sensors[] = {
new Ha::TemperatureSensor{"Living room Temperature", "temperature"},
new Ha::PressureSensor{"Living room Pressure", "pressure"},
new Ha::AltitudeSensor{"Living room Altitude", "altitude"}
new Ha::TemperatureSensor{"Temperature", "temperature"},
new Ha::PressureSensor{"Pressure", "pressure"},
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) {
String{ "ON" }.equals(msg) ? digitalWrite(LED_BUILTIN, LOW) : digitalWrite(LED_BUILTIN, HIGH);
},
@ -68,7 +68,7 @@ namespace Mqtt {
}
})->withStateTopic();
Ha::Command* brightnessMqtt = (new Ha::Brightness{ "ESP Clock Brightness", "brightness",
Ha::Command* brightnessMqtt = (new Ha::Brightness{ "Brightness", "brightness",
[](const char* msg) {
Display::Brightness::set(String{ msg }.toInt());
},
@ -79,7 +79,7 @@ namespace Mqtt {
}
})->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) {
String{ "ON" }.equals(msg) ? Display::changeHourFormat24(true) : Display::changeHourFormat24(false);
},
@ -89,7 +89,7 @@ namespace Mqtt {
})->withStateTopic();
Ha::Command* switches[] = {
new Ha::Button{"ESP Clock Restart", "restart",
new Ha::Button{"Restart", "restart",
[](const char* msg) {
if (String { "PRESS" }.equals(msg)) ESP.restart();
}