From 50d63f867808daf453d644d7035a59771f792d1a Mon Sep 17 00:00:00 2001 From: Paul C Diem Date: Fri, 13 Mar 2020 16:53:27 -0500 Subject: [PATCH] Only set power for devices included in updates --- tasmota/support_device_groups.ino | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tasmota/support_device_groups.ino b/tasmota/support_device_groups.ino index d0844de7a..f90e07c94 100644 --- a/tasmota/support_device_groups.ino +++ b/tasmota/support_device_groups.ino @@ -333,7 +333,7 @@ void _SendDeviceGroupMessage(uint8_t device_group_index, DeviceGroupMessageType if (item > DGR_ITEM_MAX_16BIT) { value >>= 8; *message_ptr++ = value & 0xff; - *message_ptr++ = value >> 8; + *message_ptr++ = (item == DGR_ITEM_POWER ? devices_present : value >> 8); } } } @@ -590,6 +590,8 @@ void ProcessDeviceGroupMessage(char * packet, int packet_length) if (DeviceGroupItemShared(true, item)) { if (item == DGR_ITEM_POWER) { + uint8_t mask_devices = value >> 24; + if (mask_devices > devices_present) mask_devices = devices_present; for (uint32_t i = 0; i < devices_present; i++) { uint32_t mask = 1 << i; bool on = (value & mask);