esphome-ratgdo/components/ratgdo/button/ratgdo_button.h

30 lines
661 B
C
Raw Normal View History

2023-06-07 23:44:58 +00:00
#pragma once
#include "../ratgdo.h"
#include "../ratgdo_child.h"
#include "../ratgdo_state.h"
#include "esphome/components/button/button.h"
#include "esphome/core/component.h"
namespace esphome {
namespace ratgdo {
enum ButtonType {
2023-06-08 00:00:15 +00:00
RATGDO_SYNC,
RATGDO_QUERY
2023-06-07 23:44:58 +00:00
};
class RATGDOButton : public button::Button, public RATGDOClient, public Component {
public:
void dump_config() override;
void set_button_type(ButtonType button_type_) { this->button_type_ = button_type_; }
2023-06-07 23:46:13 +00:00
void press_action() override;
2023-06-07 23:44:58 +00:00
protected:
ButtonType button_type_;
};
} // namespace ratgdo
} // namespace esphome