Paul Wieland 8df1cbea73
ratgdo32disco (#337)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2025-02-03 16:53:42 -06:00

32 lines
746 B
C++

#pragma once
#include "../ratgdo.h"
#include "../ratgdo_state.h"
#include "esphome/components/switch/switch.h"
#include "esphome/core/component.h"
namespace esphome {
namespace ratgdo {
enum SwitchType {
RATGDO_LEARN,
RATGDO_LED
};
class RATGDOSwitch : public switch_::Switch, public RATGDOClient, public Component {
public:
void dump_config() override;
void setup() override;
void set_switch_type(SwitchType switch_type_) { this->switch_type_ = switch_type_; }
void write_state(bool state) override;
void set_pin(GPIOPin* pin) { pin_ = pin; }
protected:
SwitchType switch_type_;
GPIOPin* pin_;
};
} // namespace ratgdo
} // namespace esphome