fix MQTT base with paths not working in HA [#1393]

This commit is contained in:
Proddy
2023-11-06 21:51:05 +01:00
parent 58cbfbc0df
commit bf5b40ccf4
7 changed files with 28 additions and 27 deletions

View File

@@ -195,7 +195,7 @@ void Shower::set_shower_state(bool state, bool force) {
doc["uniq_id"] = str;
doc["object_id"] = str;
snprintf(stat_t, sizeof(stat_t), "%s/shower_active", Mqtt::basename().c_str());
snprintf(stat_t, sizeof(stat_t), "%s/shower_active", Mqtt::base().c_str());
doc["stat_t"] = stat_t;
if (EMSESP::system_.bool_format() == BOOL_FORMAT_TRUEFALSE) {
@@ -229,7 +229,7 @@ void Shower::set_shower_state(bool state, bool force) {
doc["uniq_id"] = str;
doc["object_id"] = str;
snprintf(stat_t, sizeof(stat_t), "%s/shower_data", Mqtt::basename().c_str());
snprintf(stat_t, sizeof(stat_t), "%s/shower_data", Mqtt::base().c_str());
doc["stat_t"] = stat_t;
doc["name"] = "Shower Duration";
@@ -258,7 +258,7 @@ void Shower::set_shower_state(bool state, bool force) {
doc["uniq_id"] = str;
doc["object_id"] = str;
snprintf(stat_t, sizeof(stat_t), "%s/shower_data", Mqtt::basename().c_str());
snprintf(stat_t, sizeof(stat_t), "%s/shower_data", Mqtt::base().c_str());
doc["stat_t"] = stat_t;
doc["name"] = "Shower Timestamp";