attempt
This commit is contained in:
parent
5cde3a3354
commit
ac4dd39932
@ -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;
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user