diff --git a/include/rc_devices.h b/include/rc_devices.h index 2973e73..f47fc04 100644 --- a/include/rc_devices.h +++ b/include/rc_devices.h @@ -27,6 +27,11 @@ struct PollinSwitch : Switch { return (new string{Protocol_1::buildId(group, channel)})->c_str(); }()), group(group), channel(channel) { // cppcheck-suppress [selfInitialization] if (!name) name = (new string{string(man).append(" ").append(id)})->c_str(); + entityId = [this]() { + auto eId = string{man}; + transform(eId.begin(), eId.end(), eId.begin(), ::tolower); + return (new string{eId.append("_").append(id)})->c_str(); + }(); mainDevice = &DeviceConfig::create(id).withName(name).withManufacturer(man).withArea(area).withParent(gatewayDevice); withStateTopic(); deviceClass = "outlet"; @@ -57,6 +62,7 @@ struct EasyHomeSwitch : Switch { (*n) += remotePosition; name = n->c_str(); } + entityId = id; mainDevice = &DeviceConfig::create(id).withName(name).withManufacturer("Intertek").withModel("Easy Home").withArea(area).withParent(gatewayDevice); withStateTopic(); deviceClass = "outlet";