no need to use friend in DeviceConfig
This commit is contained in:
parent
7755950a27
commit
3a374bf685
5
src/ha.h
5
src/ha.h
@ -13,9 +13,7 @@ namespace Ha {
|
|||||||
uint16_t(*publisher)(const char* topic, const char* message);
|
uint16_t(*publisher)(const char* topic, const char* message);
|
||||||
typedef void (*onMessage)(const char* msg);
|
typedef void (*onMessage)(const char* msg);
|
||||||
|
|
||||||
struct Component;
|
|
||||||
struct DeviceConfig {
|
struct DeviceConfig {
|
||||||
friend struct Component;
|
|
||||||
const char* id = nullptr;
|
const char* id = nullptr;
|
||||||
const char* name = nullptr;
|
const char* name = nullptr;
|
||||||
const char* model = nullptr;
|
const char* model = nullptr;
|
||||||
@ -52,9 +50,6 @@ namespace Ha {
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
|
||||||
DeviceConfig(const char* id) : id(id) {}
|
|
||||||
|
|
||||||
void buildConfig(JsonDocument& jsonDoc) {
|
void buildConfig(JsonDocument& jsonDoc) {
|
||||||
JsonObject device = jsonDoc.createNestedObject("device");
|
JsonObject device = jsonDoc.createNestedObject("device");
|
||||||
if (name) device["name"] = name;
|
if (name) device["name"] = name;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user