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:34:19 +00:00
|
|
|
void write_state(light::LightState* state) override;
|
2023-06-08 01:46:44 +00:00
|
|
|
void setup_state(light::LightState* state) override;
|
2023-06-09 21:45:49 +00:00
|
|
|
void set_state(esphome::ratgdo::LightState state);
|
2023-06-07 22:14:35 +00:00
|
|
|
light::LightState* get_state() { return this->light_state_; }
|
2023-06-07 18:27:01 +00:00
|
|
|
|
2023-06-08 00:38:21 +00:00
|
|
|
void on_light_state(esphome::ratgdo::LightState state) override;
|
2023-06-07 18:27:01 +00:00
|
|
|
|
|
|
|
protected:
|
2023-06-07 22:14:35 +00:00
|
|
|
light::LightState* light_state_;
|
2023-06-09 21:51:34 +00:00
|
|
|
bool has_initial_state_ = false;
|
2023-06-07 18:27:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace ratgdo
|
|
|
|
} // namespace esphome
|