Marius Muja eee27761b2
Refactor children state update mechanism (#24)
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-07-01 09:13:38 -05:00

25 lines
530 B
C++

#include "ratgdo_sensor.h"
#include "../ratgdo_state.h"
#include "esphome/core/log.h"
namespace esphome {
namespace ratgdo {
static const char* const TAG = "ratgdo.sensor";
void RATGDOSensor::dump_config()
{
LOG_SENSOR("", "RATGDO Sensor", this);
ESP_LOGCONFIG(TAG, " Type: Openings");
}
void RATGDOSensor::setup()
{
this->parent_->subscribe_openings([=](uint16_t value) {
this->publish_state(value);
});
}
} // namespace ratgdo
} // namespace esphome