ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
bq25186_button.h
Go to the documentation of this file.
1#pragma once
2
4#ifdef USE_BUTTON
5
6#include "bq25186.h"
8
9namespace esphome::bq25186 {
10
12class BQ25186Button final : public button::Button, public Parented<BQ25186Component> {
13 public:
14 BQ25186Button(uint8_t mask, uint8_t value) : mask_(mask), value_(value) {}
15
16 protected:
17 void press_action() override { this->parent_->write_ship_rst(this->mask_, this->value_); }
18
19 const uint8_t mask_;
20 const uint8_t value_;
21};
22
23} // namespace esphome::bq25186
24
25#endif // USE_BUTTON
Helper class to easily give an object a parent of type T.
Definition helpers.h:1997
Writes one SHIP_RST field when pressed.
BQ25186Button(uint8_t mask, uint8_t value)
Base class for all buttons.
Definition button.h:25