8 #ifdef USE_BINARY_SENSOR 10 #endif // USE_BINARY_SENSOR 16 static const uint8_t GDK101_REG_READ_FIRMWARE = 0xB4;
17 static const uint8_t GDK101_REG_RESET = 0xA0;
18 static const uint8_t GDK101_REG_READ_STATUS = 0xB0;
19 static const uint8_t GDK101_REG_READ_MEASURING_TIME = 0xB1;
20 static const uint8_t GDK101_REG_READ_10MIN_AVG = 0xB2;
21 static const uint8_t GDK101_REG_READ_1MIN_AVG = 0xB3;
28 SUB_SENSOR(fw_version)
29 SUB_SENSOR(measurement_duration)
31 #ifdef USE_BINARY_SENSOR 32 SUB_BINARY_SENSOR(vibration)
33 #endif // USE_BINARY_SENSOR 36 void setup()
override;
37 void dump_config()
override;
38 float get_setup_priority()
const override;
39 void update()
override;
bool reset_sensor_(uint8_t *data)
This class simplifies creating components that periodically check a state.
bool read_fw_version_(uint8_t *data)
virtual void setup()
Where the component's initialization should happen.
bool read_bytes_with_retry_(uint8_t a_register, uint8_t *data, uint8_t len)
bool read_dose_1m_(uint8_t *data)
bool read_status_(uint8_t *data)
Implementation of SPI Controller mode.
bool read_measurement_duration_(uint8_t *data)
This Class provides the methods to read/write bytes from/to an i2c device.
bool read_dose_10m_(uint8_t *data)