no need to use friend in DeviceConfig

This commit is contained in:
Nicu Hodos 2024-10-28 08:46:48 +01:00
parent 7755950a27
commit 3a374bf685

View File

@ -13,9 +13,7 @@ namespace Ha {
uint16_t(*publisher)(const char* topic, const char* message);
typedef void (*onMessage)(const char* msg);
struct Component;
struct DeviceConfig {
friend struct Component;
const char* id = nullptr;
const char* name = nullptr;
const char* model = nullptr;
@ -52,9 +50,6 @@ namespace Ha {
return *this;
}
protected:
DeviceConfig(const char* id) : id(id) {}
void buildConfig(JsonDocument& jsonDoc) {
JsonObject device = jsonDoc.createNestedObject("device");
if (name) device["name"] = name;