Merge pull request #10997 from pcdiem/dgr2

Fix _SendDeviceGroupMessage signedness
This commit is contained in:
Theo Arends 2021-02-17 09:57:40 +01:00 committed by GitHub
commit d84de90b1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -480,7 +480,7 @@ cleanup:
}
}
bool _SendDeviceGroupMessage(uint32_t device, DevGroupMessageType message_type, ...)
bool _SendDeviceGroupMessage(int32_t device, DevGroupMessageType message_type, ...)
{
// If device groups is not up, ignore this request.
if (!device_groups_up) return 1;

View File

@ -491,7 +491,7 @@ void PWMDimmerHandleButton(uint32_t button_index, bool pressed)
}
// If we need to adjust the brightness, do it.
uint32_t negated_device_group_index = -power_button_index;
int32_t negated_device_group_index = -power_button_index;
if (bri_offset) {
int32_t bri;
#ifdef USE_PWM_DIMMER_REMOTE
@ -510,7 +510,7 @@ void PWMDimmerHandleButton(uint32_t button_index, bool pressed)
}
if (new_bri != bri) {
#ifdef USE_DEVICE_GROUPS
SendDeviceGroupMessage(negated_device_group_index, (dgr_more_to_come ? DGR_MSGTYP_UPDATE_MORE_TO_COME : DGR_MSGTYP_UPDATE_DIRECT), DGR_ITEM_LIGHT_BRI, new_bri);
SendDeviceGroupMessage(negated_device_group_index, (dgr_more_to_come ? DGR_MSGTYP_UPDATE_MORE_TO_COME : DGR_MSGTYP_UPDATE_DIRECT), DGR_ITEM_LIGHT_BRI, new_bri, DGR_ITEM_BRI_POWER_ON, new_bri);
#endif // USE_DEVICE_GROUPS
#ifdef USE_PWM_DIMMER_REMOTE
if (active_remote_pwm_dimmer) {