mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 16:29:51 +03:00
Merge pull request #1850 from MichaelDvP/dev
custom name null and fix HA CMD
This commit is contained in:
@@ -1019,7 +1019,7 @@ bool Mqtt::publish_ha_sensor_config(uint8_t type, // EMSdev
|
|||||||
doc["cmd_t"] = command_topic;
|
doc["cmd_t"] = command_topic;
|
||||||
|
|
||||||
// extend for enums and also commands, add options
|
// 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>();
|
JsonArray option_list = doc["ops"].to<JsonArray>();
|
||||||
if (EMSESP::system_.enum_format() == ENUM_FORMAT_INDEX) {
|
if (EMSESP::system_.enum_format() == ENUM_FORMAT_INDEX) {
|
||||||
// use index numbers
|
// use index numbers
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
#define EMSESP_APP_VERSION "3.7.0-dev.22"
|
#define EMSESP_APP_VERSION "3.7.0-dev.23"
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ StateUpdateResult WebCustomization::update(JsonObject root, WebCustomization & c
|
|||||||
auto emsEntity = EntityCustomization();
|
auto emsEntity = EntityCustomization();
|
||||||
emsEntity.product_id = masked_entities["product_id"];
|
emsEntity.product_id = masked_entities["product_id"];
|
||||||
emsEntity.device_id = masked_entities["device_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>()) {
|
for (const JsonVariant masked_entity_id : masked_entities["entity_ids"].as<JsonArray>()) {
|
||||||
if (masked_entity_id.is<std::string>()) {
|
if (masked_entity_id.is<std::string>()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user