light
This commit is contained in:
parent
ad987adb3c
commit
4238b28761
|
@ -12,19 +12,19 @@ namespace ratgdo {
|
||||||
LOG_BINARY_SENSOR("", "RATGDO BinarySensor", this);
|
LOG_BINARY_SENSOR("", "RATGDO BinarySensor", this);
|
||||||
ESP_LOGCONFIG(TAG, " Type: %s", this->type_ == SensorType::RATGDO_SENSOR_MOTION ? "Motion" : "Obstruction");
|
ESP_LOGCONFIG(TAG, " Type: %s", this->type_ == SensorType::RATGDO_SENSOR_MOTION ? "Motion" : "Obstruction");
|
||||||
}
|
}
|
||||||
void RATGDOBinarySensor::on_motion_state(esphome::ratgdo::MotionState state)
|
void RATGDOBinarySensor::on_motion_state(MotionState state)
|
||||||
{
|
{
|
||||||
if (this->type_ == SensorType::RATGDO_SENSOR_MOTION)
|
if (this->type_ == SensorType::RATGDO_SENSOR_MOTION)
|
||||||
this->publish_state(state == esphome::ratgdo::MotionState::MOTION_STATE_DETECTED);
|
this->publish_state(state == MotionState::MOTION_STATE_DETECTED);
|
||||||
}
|
}
|
||||||
void RATGDOBinarySensor::on_obstruction_state(esphome::ratgdo::ObstructionState state)
|
void RATGDOBinarySensor::on_obstruction_state(ObstructionState state)
|
||||||
{
|
{
|
||||||
if (this->type_ == SensorType::RATGDO_SENSOR_OBSTRUCTION)
|
if (this->type_ == SensorType::RATGDO_SENSOR_OBSTRUCTION)
|
||||||
this->publish_state(state == esphome::ratgdo::ObstructionState::OBSTRUCTION_STATE_OBSTRUCTED);
|
this->publish_state(state == ObstructionState::OBSTRUCTION_STATE_OBSTRUCTED);
|
||||||
}
|
}
|
||||||
void RATGDOBinarySensor::on_door_state(esphome::ratgdo::DoorState state) { }
|
void RATGDOBinarySensor::on_door_state(DoorState state) { }
|
||||||
void RATGDOBinarySensor::on_light_state(esphome::ratgdo::LightState state) { }
|
void RATGDOBinarySensor::on_light_state(LightState state) { }
|
||||||
void RATGDOBinarySensor::on_lock_state(esphome::ratgdo::LockState state) { }
|
void RATGDOBinarySensor::on_lock_state(:LockState state) { }
|
||||||
|
|
||||||
} // namespace ratgdo
|
} // namespace ratgdo
|
||||||
} // namespace esphome
|
} // namespace esphome
|
||||||
|
|
Loading…
Reference in New Issue