Merge pull request #1850 from MichaelDvP/dev

custom name null and fix HA CMD
This commit is contained in:
Proddy
2024-07-06 19:06:37 +02:00
committed by GitHub
3 changed files with 3 additions and 3 deletions

View File

@@ -1019,7 +1019,7 @@ bool Mqtt::publish_ha_sensor_config(uint8_t type, // EMSdev
doc["cmd_t"] = command_topic;
// extend for enums and also commands, add options
if ((type == DeviceValueType::ENUM) || (type == DeviceValueType::CMD)) {
if ((type == DeviceValueType::ENUM) || (type == DeviceValueType::CMD && uom == DeviceValueUOM::NONE)) {
JsonArray option_list = doc["ops"].to<JsonArray>();
if (EMSESP::system_.enum_format() == ENUM_FORMAT_INDEX) {
// use index numbers

View File

@@ -1 +1 @@
#define EMSESP_APP_VERSION "3.7.0-dev.22"
#define EMSESP_APP_VERSION "3.7.0-dev.23"

View File

@@ -134,7 +134,7 @@ StateUpdateResult WebCustomization::update(JsonObject root, WebCustomization & c
auto emsEntity = EntityCustomization();
emsEntity.product_id = masked_entities["product_id"];
emsEntity.device_id = masked_entities["device_id"];
emsEntity.custom_name = masked_entities["custom_name"].as<std::string>();
emsEntity.custom_name = masked_entities["custom_name"] | "";
for (const JsonVariant masked_entity_id : masked_entities["entity_ids"].as<JsonArray>()) {
if (masked_entity_id.is<std::string>()) {