2023-06-07 18:27:01 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "../ratgdo.h"
|
|
|
|
#include "../ratgdo_child.h"
|
|
|
|
#include "../ratgdo_state.h"
|
|
|
|
#include "esphome/components/light/light_output.h"
|
|
|
|
#include "esphome/core/component.h"
|
|
|
|
|
|
|
|
namespace esphome {
|
|
|
|
namespace ratgdo {
|
|
|
|
|
|
|
|
class RATGDOLightOutput : public light::LightOutput, public RATGDOClient, public Component {
|
|
|
|
public:
|
|
|
|
void dump_config() override;
|
|
|
|
light::LightTraits get_traits() override;
|
2023-06-07 18:32:37 +00:00
|
|
|
void RATGDOLightOutput::write_state(light::LightState* state) override;
|
2023-06-07 18:28:37 +00:00
|
|
|
void setup_state(light::LightState* state) override { this->state_ = state; }
|
2023-06-07 18:31:49 +00:00
|
|
|
light::LightState* get_state() { return this->state_; }
|
2023-06-07 18:27:01 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
bool _is_on;
|
|
|
|
light::LightState* state_;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace ratgdo
|
|
|
|
} // namespace esphome
|