From dcc30bac72f5ec476e5d2d8da8c77ae7bcc77de8 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 7 Jun 2023 14:11:03 -0500 Subject: [PATCH] light --- .../binary_sensor/ratgdo_binary_sensor.h | 10 +++++----- components/ratgdo/cover/ratgdo_cover.cpp | 20 +++++++++---------- components/ratgdo/cover/ratgdo_cover.h | 10 +++++----- .../ratgdo/light/ratgdo_light_output.cpp | 10 +++++----- components/ratgdo/light/ratgdo_light_output.h | 10 +++++----- 5 files changed, 30 insertions(+), 30 deletions(-) diff --git a/components/ratgdo/binary_sensor/ratgdo_binary_sensor.h b/components/ratgdo/binary_sensor/ratgdo_binary_sensor.h index caf5763..22724f1 100644 --- a/components/ratgdo/binary_sensor/ratgdo_binary_sensor.h +++ b/components/ratgdo/binary_sensor/ratgdo_binary_sensor.h @@ -19,11 +19,11 @@ namespace ratgdo { void dump_config() override; void set_type(SensorType type) { type_ = type_; } - void on_motion_state(esphome::ratgdo::MotionState state) override; - void on_obstruction_state(esphome::ratgdo::ObstructionState state) override; - void on_door_state(esphome::ratgdo::DoorState state) override; - void on_light_state(esphome::ratgdo::LightState state) override; - void on_lock_state(esphome::ratgdo::LockState state) override; + void on_motion_state(MotionState state) override; + void on_obstruction_state(ObstructionState state) override; + void on_door_state(DoorState state) override; + void on_light_state(LightState state) override; + void on_lock_state(LockState state) override; protected: SensorType type_; diff --git a/components/ratgdo/cover/ratgdo_cover.cpp b/components/ratgdo/cover/ratgdo_cover.cpp index 0480209..9e42072 100644 --- a/components/ratgdo/cover/ratgdo_cover.cpp +++ b/components/ratgdo/cover/ratgdo_cover.cpp @@ -13,26 +13,26 @@ namespace ratgdo { { LOG_COVER("", "RATGDO Cover", this); } - void RATGDOCover::on_motion_state(esphome::ratgdo::MotionState state) { } - void RATGDOCover::on_obstruction_state(esphome::ratgdo::ObstructionState state) { } - void RATGDOCover::on_door_state(esphome::ratgdo::DoorState state) + void RATGDOCover::on_motion_state(MotionState state) { } + void RATGDOCover::on_obstruction_state(ObstructionState state) { } + void RATGDOCover::on_door_state(DoorState state) { switch (state) { - case esphome::ratgdo::DoorState::DOOR_STATE_OPEN: + case DoorState::DOOR_STATE_OPEN: this->position = COVER_OPEN; this->current_operation = COVER_OPERATION_IDLE; break; - case esphome::ratgdo::DoorState::DOOR_STATE_CLOSED: + case DoorState::DOOR_STATE_CLOSED: this->position = COVER_CLOSED; this->current_operation = COVER_OPERATION_IDLE; break; - case esphome::ratgdo::DoorState::DOOR_STATE_OPENING: + case DoorState::DOOR_STATE_OPENING: this->current_operation = COVER_OPERATION_OPENING; break; - case esphome::ratgdo::DoorState::DOOR_STATE_CLOSING: + case DoorState::DOOR_STATE_CLOSING: this->current_operation = COVER_OPERATION_CLOSING; break; - case esphome::ratgdo::DoorState::DOOR_STATE_STOPPED: + case DoorState::DOOR_STATE_STOPPED: default: this->current_operation = COVER_OPERATION_IDLE; @@ -41,8 +41,8 @@ namespace ratgdo { this->publish_state(); } - void RATGDOCover::on_light_state(esphome::ratgdo::LightState state) { } - void RATGDOCover::on_lock_state(esphome::ratgdo::LockState state) { } + void RATGDOCover::on_light_state(LightState state) { } + void RATGDOCover::on_lock_state(LockState state) { } CoverTraits RATGDOCover::get_traits() { diff --git a/components/ratgdo/cover/ratgdo_cover.h b/components/ratgdo/cover/ratgdo_cover.h index d8ba860..64aa026 100644 --- a/components/ratgdo/cover/ratgdo_cover.h +++ b/components/ratgdo/cover/ratgdo_cover.h @@ -14,11 +14,11 @@ namespace ratgdo { void dump_config() override; cover::CoverTraits get_traits() override; - void on_motion_state(esphome::ratgdo::MotionState state) override; - void on_obstruction_state(esphome::ratgdo::ObstructionState state) override; - void on_door_state(esphome::ratgdo::DoorState state) override; - void on_light_state(esphome::ratgdo::LightState state) override; - void on_lock_state(esphome::ratgdo::LockState state) override; + void on_motion_state(MotionState state) override; + void on_obstruction_state(ObstructionState state) override; + void on_door_state(DoorState state) override; + void on_light_state(LightState state) override; + void on_lock_state(LockState state) override; protected: void control(const cover::CoverCall& call) override; diff --git a/components/ratgdo/light/ratgdo_light_output.cpp b/components/ratgdo/light/ratgdo_light_output.cpp index 286e6ca..0c12172 100644 --- a/components/ratgdo/light/ratgdo_light_output.cpp +++ b/components/ratgdo/light/ratgdo_light_output.cpp @@ -13,11 +13,11 @@ namespace ratgdo { { ESP_LOGCONFIG("", "RATGDO Light"); } - void RATGDOLightOutput::on_motion_state(esphome::ratgdo::MotionState state) { } - void RATGDOLightOutput::on_obstruction_state(esphome::ratgdo::ObstructionState state) { } - void RATGDOLightOutput::on_door_state(esphome::ratgdo::DoorState state) { } - void RATGDOLightOutput::on_light_state(esphome::ratgdo::LightState state) { } - void RATGDOLightOutput::on_lock_state(esphome::ratgdo::LockState state) { } + void RATGDOLightOutput::on_motion_state(MotionState state) { } + void RATGDOLightOutput::on_obstruction_state(ObstructionState state) { } + void RATGDOLightOutput::on_door_state(DoorState state) { } + void RATGDOLightOutput::on_light_state(LightState state) { } + void RATGDOLightOutput::on_lock_state(LockState state) { } LightTraits RATGDOLightOutput::get_traits() { diff --git a/components/ratgdo/light/ratgdo_light_output.h b/components/ratgdo/light/ratgdo_light_output.h index f917916..40bdce2 100644 --- a/components/ratgdo/light/ratgdo_light_output.h +++ b/components/ratgdo/light/ratgdo_light_output.h @@ -17,11 +17,11 @@ namespace ratgdo { void setup_state(light::LightState* state) override { this->state_ = state; } light::LightState* get_state() { return this->state_; } - void on_motion_state(esphome::ratgdo::MotionState state) override; - void on_obstruction_state(esphome::ratgdo::ObstructionState state) override; - void on_door_state(esphome::ratgdo::DoorState state) override; - void on_light_state(esphome::ratgdo::LightState state) override; - void on_lock_state(esphome::ratgdo::LockState state) override; + void on_motion_state(MotionState state) override; + void on_obstruction_state(ObstructionState state) override; + void on_door_state(DoorState state) override; + void on_light_state(LightState state) override; + void on_lock_state(LockState state) override; protected: bool _is_on;