ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
seeed_multi_channel_relay.h
Go to the documentation of this file.
1#pragma once
2
3#include <array>
4
8
9#ifdef USE_SWITCH
11#endif
12
14
16 public:
17 void setup() override;
18 void dump_config() override;
19
21 void change_address(uint8_t address);
22
24 bool set_relay(uint8_t channel, bool on);
25
26#ifdef USE_SWITCH
27 void register_switch(uint8_t channel, switch_::Switch *sw) { this->switches_[channel] = sw; }
28#endif
29
30 protected:
31 uint8_t channels_{0};
33#ifdef USE_SWITCH
34 std::array<switch_::Switch *, 8> switches_{};
35#endif
36};
37
38} // namespace esphome::seeed_multi_channel_relay
uint8_t address
Definition bl0906.h:4
This Class provides the methods to read/write bytes from/to an i2c device.
Definition i2c.h:144
void change_address(uint8_t address)
Store a new I2C address in the board's EEPROM and talk to it there from now on.
bool set_relay(uint8_t channel, bool on)
Switch relay channel (0-7) on or off; returns false when the write failed.
Base class for all switches.
Definition switch.h:43