1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-02 11:22:24 +01:00

Add a function to return the I2C address from an I2CDevice object (#8454)

Co-authored-by: Djordje Mandic <6750655+DjordjeMandic@users.noreply.github.com>
This commit is contained in:
Pat Satyshur
2025-04-30 20:14:29 -05:00
committed by GitHub
parent 9a9b91b180
commit b597565165

View File

@@ -139,6 +139,10 @@ class I2CDevice {
/// @param address of the device
void set_i2c_address(uint8_t address) { address_ = address; }
/// @brief Returns the I2C address of the object.
/// @return the I2C address
uint8_t get_i2c_address() const { return this->address_; }
/// @brief we store the pointer to the I2CBus to use
/// @param bus pointer to the I2CBus object
void set_i2c_bus(I2CBus *bus) { bus_ = bus; }