Back to highest numbered relay for default count, Only send event message if not group message

This commit is contained in:
Paul C Diem 2021-10-11 08:39:49 -05:00
parent d9662ffab7
commit b9ab9737f8
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 // If relays in separate device groups is enabled, set the device group count to highest numbered
// button. // button.
if (Settings->flag4.multiple_device_groups) { // SetOption88 - Enable relays in separate device groups if (Settings->flag4.multiple_device_groups) { // SetOption88 - Enable relays in separate device groups
for (uint32_t index = 0; index < MAX_KEYS; index++) { for (uint32_t relay_index = 0; relay_index < MAX_RELAYS; relay_index++) {
if (PinUsed(GPIO_KEY1, index)) device_group_count = index + 1; 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) { if (XdrvMailbox.data_len > 0) {
strlcpy(Rules.event_data, XdrvMailbox.data, sizeof(Rules.event_data)); strlcpy(Rules.event_data, XdrvMailbox.data, sizeof(Rules.event_data));
#ifdef USE_DEVICE_GROUPS #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 #endif // USE_DEVICE_GROUPS
} }
if (XdrvMailbox.command) ResponseCmndDone(); if (XdrvMailbox.command) ResponseCmndDone();