Browse Source

relay: stable configuration IDs

Custom provider cannot 'shadow' the relays from the config.
e.g. lights will use the id=0 when relay control is enabled, and
we should not use relayGpio0, relayPulse0, relayBoot0 and etc.
dev
Maxim Prokhorov 3 years ago
parent
commit
04569c6a10
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      code/espurna/relay.cpp

+ 3
- 2
code/espurna/relay.cpp View File

@ -1985,9 +1985,10 @@ RelayProviderBasePtr _relaySetupProvider(unsigned char index) {
}
void _relaySetup() {
_relays.reserve(_relayAdhocPins());
auto relays = _relays.size();
_relays.reserve(relays + _relayAdhocPins());
for (unsigned char id = 0; id < RelaysMax; ++id) {
for (unsigned char id = relays; id < RelaysMax; ++id) {
auto impl = _relaySetupProvider(id);
if (!impl) {
break;


Loading…
Cancel
Save