This commit is contained in:
Nicu Hodos 2024-05-03 12:32:54 +02:00
parent 5cde3a3354
commit ac4dd39932
2 changed files with 4 additions and 5 deletions

View File

@ -7,7 +7,7 @@
using namespace Ha;
DeviceConfig* gatewayDevice = (new DeviceConfig{MAIN_DEVICE_ID, "RC Gateway"})->withManufacturer("Adafruit")->withModel("Huzzah Esp8266");
DeviceConfig* atTinyDevice = (new DeviceConfig{})->withManufacturer("Atmel")->withModel("AtTiny85")->withParent(gatewayDevice);
DeviceConfig* atTinyDevice = (new DeviceConfig{"id4", "Oil"})->withManufacturer("Atmel")->withModel("AtTiny85")->withParent(gatewayDevice);
struct PollinSwitch : Switch {
const char* group;

View File

@ -33,7 +33,9 @@ namespace Mqtt {
}
Ha::Sensor* sensors[] = {
(new Ha::TemperatureSensor{"Oil tank room1", "id4"})->withArea("Basement")->withStateTopic()->copyFromDevice(atTinyDevice)
(new Ha::TemperatureSensor{"Oil tank room1", "id4"})
// (new Ha::TemperatureSensor{"Oil tank room1", "id4"})->withArea("Basement")->withStateTopic()//->asDevice(atTinyDevice)
// (new Ha::TemperatureSensor{"Oil tank room1", "id4"})->asDevice(atTinyDevice)
// new Ha::TemperatureSensor{"Temperature", "temperature"},
// new Ha::HumiditySensor{"Humidity", "humidity"},
// new Ha::PressureSensor{"Pressure", "pressure"},
@ -72,9 +74,6 @@ namespace Mqtt {
for (List<Ha::Component>::Container* c = Ha::Component::components.first; c; c = c->next) {
publishComponentConfig(*c->t);
}
for (Ha::Component* cmp : sensors) {
publishComponentConfig(*cmp);
}
ts.deleteTask(tPublishInit);
}