7#ifdef USE_BINARY_SENSOR
25#ifdef HYDREON_RGXX_NUM_SENSORS
26static const uint8_t NUM_SENSORS = HYDREON_RGXX_NUM_SENSORS;
28static const uint8_t NUM_SENSORS = 1;
31#ifndef HYDREON_RGXX_PROTOCOL_LIST
32#define HYDREON_RGXX_PROTOCOL_LIST(F, SEP) F("")
35#define HYDREON_RGXX_IGNORE_LIST(F, SEP) F("Emitters") SEP F("Event") SEP F("Reset")
40#ifdef USE_BINARY_SENSOR
54 void setup()
override;
66#ifdef USE_BINARY_SENSOR
Collects bytes into NUL terminated lines of up to N - 1 characters; IGNORE_CHAR bytes are skipped and...
This class simplifies creating components that periodically check a state.
StringRef is a reference to a string owned by something else.
Base class for all binary_sensor-type classes.
HydreonRGxxBinaryComponent(HydreonRGxxComponent *parent)
void update() override
Schedule data readings.
void setup() override
Setup the sensor and test for a connection.
binary_sensor::BinarySensor * em_sat_sensor_
void set_resolution(RG15Resolution resolution)
binary_sensor::BinarySensor * lens_bad_sensor_
void set_lens_bad_sensor(binary_sensor::BinarySensor *sensor)
void set_disable_led(bool disable_led)
void set_sensor(sensor::Sensor *sensor, int index)
int16_t no_response_count_
int num_sensors_missing_()
void process_line_(StringRef line)
line is NUL terminated
void set_request_temperature(bool b)
bool request_temperature_
LineReader< 80 > line_reader_
void schedule_reboot_()
Communication with the sensor is asynchronous.
RG15Resolution resolution_
binary_sensor::BinarySensor * too_cold_sensor_
void loop() override
Read data once available.
sensor::Sensor * sensors_[NUM_SENSORS]
void set_too_cold_sensor(binary_sensor::BinarySensor *sensor)
void set_em_sat_sensor(binary_sensor::BinarySensor *sensor)
void dump_config() override
void set_model(RGModel model)
Base-class for all sensors.