fix command name for custom entities

This commit is contained in:
MichaelDvP
2024-09-20 14:14:37 +02:00
parent c2b52f731c
commit c315463692

View File

@@ -129,9 +129,9 @@ StateUpdateResult WebCustomEntity::update(JsonObject root, WebCustomEntity & web
if (entityItem.writeable && !entityItem.name.empty()) { if (entityItem.writeable && !entityItem.name.empty()) {
Command::add( Command::add(
EMSdevice::DeviceType::CUSTOM, EMSdevice::DeviceType::CUSTOM,
entityItem.name.c_str(), webCustomEntity.customEntityItems.back().name.c_str(),
[entityItem](const char * value, const int8_t id) { [webCustomEntity](const char * value, const int8_t id) {
return EMSESP::webCustomEntityService.command_setvalue(value, id, entityItem.name.c_str()); return EMSESP::webCustomEntityService.command_setvalue(value, id, webCustomEntity.customEntityItems.back().name.c_str());
}, },
FL_(entity_cmd), FL_(entity_cmd),
CommandFlag::ADMIN_ONLY); CommandFlag::ADMIN_ONLY);