HA val_tpl for undefined boottime None

This commit is contained in:
MichaelDvP
2026-08-10 10:11:01 +02:00
parent 73f2634acc
commit 52486ed5b4
+1 -1
View File
@@ -1136,7 +1136,7 @@ bool Mqtt::publish_ha_sensor_config(uint8_t type, // EMSdev
doc["val_tpl"] = val_tpl; doc["val_tpl"] = val_tpl;
} else if (uom == DeviceValueUOM::UPTIME) { } else if (uom == DeviceValueUOM::UPTIME) {
// uptime // uptime
doc["val_tpl"] = (std::string) "{{" + val_obj + " if " + val_cond + " else '' }}"; doc["val_tpl"] = (std::string) "{{" + val_obj + " if " + val_cond + " else 'None' }}";
} else { } else {
// default // default
doc["val_tpl"] = (std::string) "{{" + val_obj + " if " + val_cond + " else " + sample_val + "}}"; doc["val_tpl"] = (std::string) "{{" + val_obj + " if " + val_cond + " else " + sample_val + "}}";