Files
esphome/components/ratgdo/binary_sensor/ratgdo_binary_sensor.h
T

30 lines
779 B
C++

#pragma once
#include "../ratgdo.h"
#include "../ratgdo_state.h"
#include "esphome/components/binary_sensor/binary_sensor.h"
#include "esphome/core/component.h"
#include "esphome/core/defines.h"
namespace esphome::ratgdo {
enum SensorType : uint8_t {
#ifdef RATGDO_USE_VEHICLE_SENSORS
RATGDO_SENSOR_VEHICLE_DETECTED = 4,
RATGDO_SENSOR_VEHICLE_ARRIVING,
RATGDO_SENSOR_VEHICLE_LEAVING,
#endif
};
class RATGDOBinarySensor : public binary_sensor::BinarySensor, public RATGDOClient, public Component {
public:
void setup() override;
void dump_config() override;
void set_binary_sensor_type(SensorType binary_sensor_type) { this->binary_sensor_type_ = binary_sensor_type; }
protected:
SensorType binary_sensor_type_;
};
} // namespace esphome::ratgdo