esphome-ratgdo/components/ratgdo/switch/ratgdo_switch.h

30 lines
703 B
C
Raw Normal View History

2023-06-09 20:54:20 +00:00
#pragma once
#include "../ratgdo.h"
#include "../ratgdo_child.h"
#include "../ratgdo_state.h"
#include "esphome/components/switch/switch.h"
#include "esphome/core/component.h"
namespace esphome {
namespace ratgdo {
enum SwitchType {
RATGDO_LOCK
};
2023-06-09 20:55:48 +00:00
class RATGDOSwitch : public switch_::Switch, public RATGDOClient, public Component {
2023-06-09 20:54:20 +00:00
public:
void dump_config() override;
void set_switch_type(SwitchType switch_type_) { this->switch_type_ = switch_type_; }
void on_lock_state(LockState state) override;
2023-06-09 20:58:55 +00:00
void write_state(bool state) override;
2023-06-09 20:54:20 +00:00
protected:
SwitchType switch_type_;
};
} // namespace ratgdo
} // namespace esphome