25 lines
530 B
C++
Raw Normal View History

2023-06-09 17:36:56 -05:00
#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()
2023-06-09 17:36:56 -05:00
{
this->parent_->subscribe_openings([=](uint16_t value) {
this->publish_state(value);
});
2023-06-09 17:36:56 -05:00
}
} // namespace ratgdo
} // namespace esphome