loop
This commit is contained in:
parent
8996888705
commit
32f76632c7
|
@ -26,21 +26,24 @@ namespace ratgdo {
|
|||
}
|
||||
void RATGDOBinarySensor::on_motion_state(MotionState state)
|
||||
{
|
||||
if (this->binary_sensor_type_ != SensorType::RATGDO_SENSOR_MOTION)
|
||||
return;
|
||||
ESP_LOGD(TAG, "name: %s this->type_:%d on_motion_state: %d", this->get_name(), this->binary_sensor_type_, state);
|
||||
if (this->binary_sensor_type_ == SensorType::RATGDO_SENSOR_MOTION)
|
||||
this->publish_state(state == MotionState::MOTION_STATE_DETECTED);
|
||||
this->publish_state(state == MotionState::MOTION_STATE_DETECTED);
|
||||
}
|
||||
void RATGDOBinarySensor::on_obstruction_state(ObstructionState state)
|
||||
{
|
||||
if (this->binary_sensor_type_ != SensorType::RATGDO_SENSOR_OBSTRUCTION)
|
||||
return;
|
||||
ESP_LOGD(TAG, "name: %s this->type_:%d on_obstruction_state: %d", this->get_name(), this->binary_sensor_type_, state);
|
||||
if (this->binary_sensor_type_ == SensorType::RATGDO_SENSOR_OBSTRUCTION)
|
||||
this->publish_state(state == ObstructionState::OBSTRUCTION_STATE_OBSTRUCTED);
|
||||
this->publish_state(state == ObstructionState::OBSTRUCTION_STATE_OBSTRUCTED);
|
||||
}
|
||||
void RATGDOBinarySensor::on_motor_state(MotorState state)
|
||||
{
|
||||
if (this->binary_sensor_type_ != SensorType::RATGDO_SENSOR_MOTOR)
|
||||
return;
|
||||
ESP_LOGD(TAG, "name: %s this->type_:%d on_motor_state: %d", this->get_name(), this->binary_sensor_type_, state);
|
||||
if (this->binary_sensor_type_ == SensorType::RATGDO_SENSOR_MOTOR)
|
||||
this->publish_state(state == MotorState::MOTOR_STATE_ON);
|
||||
this->publish_state(state == MotorState::MOTOR_STATE_ON);
|
||||
}
|
||||
|
||||
} // namespace ratgdo
|
||||
|
|
Loading…
Reference in New Issue