fix light state

This commit is contained in:
J. Nick Koston 2023-06-07 17:24:46 -05:00
parent a75243023b
commit 43453573d8
No known key found for this signature in database
1 changed files with 6 additions and 0 deletions

View File

@ -7,6 +7,12 @@ namespace ratgdo {
static const char* const TAG = "ratgdo.binary_sensor"; static const char* const TAG = "ratgdo.binary_sensor";
void RATGDOBinarySensor::setup()
{
if (this->binary_sensor_type_ == SensorType::RATGDO_SENSOR_MOTION)
this->publish_state(state == MotionState::MOTION_STATE_CLEAR);
}
void RATGDOBinarySensor::dump_config() void RATGDOBinarySensor::dump_config()
{ {
LOG_BINARY_SENSOR("", "RATGDO BinarySensor", this); LOG_BINARY_SENSOR("", "RATGDO BinarySensor", this);