2023-06-07 10:37:51 -05:00
|
|
|
#pragma once
|
|
|
|
|
2023-06-07 11:41:02 -05:00
|
|
|
#include "../ratgdo.h"
|
2023-06-07 10:37:51 -05:00
|
|
|
#include "../ratgdo_state.h"
|
|
|
|
#include "esphome/components/binary_sensor/binary_sensor.h"
|
2023-06-07 11:41:02 -05:00
|
|
|
#include "esphome/core/component.h"
|
2023-06-07 10:37:51 -05:00
|
|
|
|
|
|
|
namespace esphome {
|
|
|
|
namespace ratgdo {
|
|
|
|
|
2023-06-07 11:41:02 -05:00
|
|
|
enum SensorType {
|
|
|
|
RATGDO_SENSOR_MOTION,
|
|
|
|
RATGDO_SENSOR_OBSTRUCTION,
|
2023-06-09 18:07:26 -05:00
|
|
|
RATGDO_SENSOR_MOTOR,
|
|
|
|
RATGDO_SENSOR_BUTTON
|
2023-06-07 11:41:02 -05:00
|
|
|
};
|
2023-06-07 10:37:51 -05:00
|
|
|
|
2023-06-07 11:41:02 -05:00
|
|
|
class RATGDOBinarySensor : public binary_sensor::BinarySensor, public RATGDOClient, public Component {
|
|
|
|
public:
|
2023-06-07 17:25:14 -05:00
|
|
|
void setup() override;
|
2023-06-07 11:41:02 -05:00
|
|
|
void dump_config() override;
|
2023-07-02 19:44:34 -07:00
|
|
|
void set_binary_sensor_type(SensorType binary_sensor_type) { this->binary_sensor_type_ = binary_sensor_type; }
|
2023-06-07 11:31:02 -05:00
|
|
|
|
2023-06-07 11:41:02 -05:00
|
|
|
protected:
|
2023-06-07 14:48:20 -05:00
|
|
|
SensorType binary_sensor_type_;
|
2023-06-07 11:41:02 -05:00
|
|
|
};
|
2023-06-07 10:37:51 -05:00
|
|
|
|
2023-06-07 11:41:02 -05:00
|
|
|
} // namespace ratgdo
|
|
|
|
} // namespace esphome
|