ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
bq25186_text_sensor.h
Go to the documentation of this file.
1#pragma once
2
4#ifdef USE_TEXT_SENSOR
5
6#include "bq25186.h"
8
9namespace esphome::bq25186 {
10
13 public:
14 BQ25186TextSensor(uint8_t reg, uint8_t shift, uint8_t first) : reg_(reg), shift_(shift), first_(first) {}
15 void on_status(const BQ25186StatusRegisters &status);
16
17 protected:
18 const uint8_t reg_;
19 const uint8_t shift_;
20 const uint8_t first_;
21 uint8_t last_{0xFF}; // the field value last published
22};
23
24} // namespace esphome::bq25186
25
26#endif // USE_TEXT_SENSOR
A two-bit status field; first is the string table index of the field's value 0.
void on_status(const BQ25186StatusRegisters &status)
BQ25186TextSensor(uint8_t reg, uint8_t shift, uint8_t first)
std::array< uint8_t, BQ25186_STATUS_REGISTER_COUNT > BQ25186StatusRegisters
Definition bq25186.h:39