ESPHome
2026.11.0-dev
Loading...
Searching...
No Matches
esphome
components
husb238
husb238.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
esphome/components/i2c/i2c.h
"
4
#include "
esphome/core/component.h
"
5
#include "
esphome/core/defines.h
"
6
#ifdef USE_BINARY_SENSOR
7
#include "
esphome/components/binary_sensor/binary_sensor.h
"
8
#endif
9
10
namespace
esphome::husb238
{
11
12
static
constexpr
uint8_t REG_PD_STATUS1 = 0x01;
13
static
constexpr
uint8_t PD_STATUS1_ATTACHED = 1 << 6;
14
static
constexpr
uint8_t PD_STATUS1_CC_DIR = 1 << 7;
15
16
class
Husb238Component
:
public
PollingComponent
,
public
i2c::I2CDevice
{
17
public
:
18
void
setup
()
override
;
19
void
update
()
override
;
20
void
dump_config
()
override
;
21
22
#ifdef USE_BINARY_SENSOR
23
SUB_BINARY_SENSOR(attached)
24
SUB_BINARY_SENSOR(cc_direction)
25
#endif
26
};
27
28
}
// namespace esphome::husb238
binary_sensor.h
esphome::PollingComponent
This class simplifies creating components that periodically check a state.
Definition
component.h:514
esphome::husb238::Husb238Component
Definition
husb238.h:16
esphome::husb238::Husb238Component::setup
void setup() override
Definition
husb238.cpp:8
esphome::husb238::Husb238Component::dump_config
void dump_config() override
Definition
husb238.cpp:38
esphome::husb238::Husb238Component::update
void update() override
Definition
husb238.cpp:15
esphome::i2c::I2CDevice
This Class provides the methods to read/write bytes from/to an i2c device.
Definition
i2c.h:132
component.h
defines.h
i2c.h
esphome::husb238
Definition
husb238.cpp:4
Generated by
1.12.0