8#ifdef USE_BINARY_SENSOR
19static const uint8_t GDK101_REG_READ_FIRMWARE = 0xB4;
20static const uint8_t GDK101_REG_RESET = 0xA0;
21static const uint8_t GDK101_REG_READ_STATUS = 0xB0;
22static const uint8_t GDK101_REG_READ_MEASURING_TIME = 0xB1;
23static const uint8_t GDK101_REG_READ_10MIN_AVG = 0xB2;
24static const uint8_t GDK101_REG_READ_1MIN_AVG = 0xB3;
31 SUB_SENSOR(measurement_duration)
33#ifdef USE_BINARY_SENSOR
34 SUB_BINARY_SENSOR(vibration)
37 SUB_TEXT_SENSOR(fw_version)
41 void setup()
override;
42 void dump_config()
override;
43 float get_setup_priority()
const override;
44 void update()
override;
virtual void setup()
Where the component's initialization should happen.
This class simplifies creating components that periodically check a state.
bool read_status_(uint8_t *data)
bool read_bytes_with_retry_(uint8_t a_register, uint8_t *data, uint8_t len)
bool read_dose_1m_(uint8_t *data)
bool read_dose_10m_(uint8_t *data)
bool read_fw_version_(uint8_t *data)
bool reset_sensor_(uint8_t *data)
bool read_measurement_duration_(uint8_t *data)
This Class provides the methods to read/write bytes from/to an i2c device.
Providing packet encoding functions for exchanging data with a remote host.