From 43453573d8f453d7c2bcefe01666e747cda64f76 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 7 Jun 2023 17:24:46 -0500 Subject: [PATCH] fix light state --- components/ratgdo/binary_sensor/ratgdo_binary_sensor.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/ratgdo/binary_sensor/ratgdo_binary_sensor.cpp b/components/ratgdo/binary_sensor/ratgdo_binary_sensor.cpp index 59a06e1..0430bb1 100644 --- a/components/ratgdo/binary_sensor/ratgdo_binary_sensor.cpp +++ b/components/ratgdo/binary_sensor/ratgdo_binary_sensor.cpp @@ -7,6 +7,12 @@ namespace ratgdo { 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() { LOG_BINARY_SENSOR("", "RATGDO BinarySensor", this);