This commit is contained in:
J. Nick Koston 2023-06-07 14:34:29 -05:00
parent 2b58eec35b
commit 905ae2de66
No known key found for this signature in database
1 changed files with 2 additions and 0 deletions

View File

@ -14,11 +14,13 @@ namespace ratgdo {
}
void RATGDOBinarySensor::on_motion_state(MotionState state)
{
ESP_LOGD(TAG, "this->type_:%s on_motion_state: %d", this->type_, state);
if (this->type_ == SensorType::RATGDO_SENSOR_MOTION)
this->publish_state(state == MotionState::MOTION_STATE_DETECTED);
}
void RATGDOBinarySensor::on_obstruction_state(ObstructionState state)
{
ESP_LOGD(TAG, "this->type_:%s on_obstruction_state: %d", this->type_, state);
if (this->type_ == SensorType::RATGDO_SENSOR_OBSTRUCTION)
this->publish_state(state == ObstructionState::OBSTRUCTION_STATE_OBSTRUCTED);
}