Merge pull request #13329 from pcdiem/dgr2

Back to highest numbered relay for default count, Only send event mes…
This commit is contained in:
Theo Arends 2021-10-11 16:10:52 +02:00 committed by GitHub
commit 9b78500387
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -113,8 +113,8 @@ void DeviceGroupsInit(void)
// If relays in separate device groups is enabled, set the device group count to highest numbered
// button.
if (Settings->flag4.multiple_device_groups) { // SetOption88 - Enable relays in separate device groups
for (uint32_t index = 0; index < MAX_KEYS; index++) {
if (PinUsed(GPIO_KEY1, index)) device_group_count = index + 1;
for (uint32_t relay_index = 0; relay_index < MAX_RELAYS; relay_index++) {
if (PinUsed(GPIO_REL1, relay_index)) device_group_count = relay_index + 1;
}
}

View File

@ -2200,7 +2200,7 @@ void CmndEvent(void)
if (XdrvMailbox.data_len > 0) {
strlcpy(Rules.event_data, XdrvMailbox.data, sizeof(Rules.event_data));
#ifdef USE_DEVICE_GROUPS
SendDeviceGroupMessage(1, DGR_MSGTYP_UPDATE, DGR_ITEM_EVENT, XdrvMailbox.data);
if (!XdrvMailbox.grpflg) SendDeviceGroupMessage(1, DGR_MSGTYP_UPDATE, DGR_ITEM_EVENT, XdrvMailbox.data);
#endif // USE_DEVICE_GROUPS
}
if (XdrvMailbox.command) ResponseCmndDone();