mirror of
https://github.com/arendst/Tasmota.git
synced 2025-04-25 07:17:16 +00:00
Merge pull request #8500 from pcdiem/pwm-dimmer-11
Publish state when dimmer button tapped
This commit is contained in:
commit
9e804c7ef8
@ -552,6 +552,7 @@ void PWMDimmerHandleButton(void)
|
|||||||
if (button_hold_time[button_index] >= now) {
|
if (button_hold_time[button_index] >= now) {
|
||||||
bri_offset = (is_down_button ? -1 : 1);
|
bri_offset = (is_down_button ? -1 : 1);
|
||||||
dgr_item = 255;
|
dgr_item = 255;
|
||||||
|
state_updated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the button was held and the hold was not processed by a rule, we changed the
|
// If the button was held and the hold was not processed by a rule, we changed the
|
||||||
@ -601,7 +602,7 @@ void PWMDimmerHandleButton(void)
|
|||||||
}
|
}
|
||||||
if (new_bri != bri) {
|
if (new_bri != bri) {
|
||||||
#ifdef USE_DEVICE_GROUPS
|
#ifdef USE_DEVICE_GROUPS
|
||||||
SendDeviceGroupMessage(power_button_index, (dgr_item ? DGR_MSGTYP_UPDATE : DGR_MSGTYP_UPDATE_MORE_TO_COME), DGR_ITEM_LIGHT_BRI, new_bri);
|
SendDeviceGroupMessage(power_button_index, DGR_MSGTYP_UPDATE_MORE_TO_COME, DGR_ITEM_LIGHT_BRI, new_bri);
|
||||||
#endif // USE_DEVICE_GROUPS
|
#endif // USE_DEVICE_GROUPS
|
||||||
#ifdef USE_PWM_DIMMER_REMOTE
|
#ifdef USE_PWM_DIMMER_REMOTE
|
||||||
if (!active_device_is_local)
|
if (!active_device_is_local)
|
||||||
@ -663,7 +664,7 @@ void PWMDimmerHandleButton(void)
|
|||||||
|
|
||||||
// If we're not changing the brightness or toggling the power and we made changes, send a group
|
// If we're not changing the brightness or toggling the power and we made changes, send a group
|
||||||
// update.
|
// update.
|
||||||
else if (dgr_item) {
|
if (dgr_item) {
|
||||||
#ifdef USE_DEVICE_GROUPS
|
#ifdef USE_DEVICE_GROUPS
|
||||||
if (dgr_item == 255) dgr_item = 0;
|
if (dgr_item == 255) dgr_item = 0;
|
||||||
SendDeviceGroupMessage(power_button_index, (dgr_more_to_come ? DGR_MSGTYP_UPDATE_MORE_TO_COME : DGR_MSGTYP_UPDATE_DIRECT), dgr_item, dgr_value);
|
SendDeviceGroupMessage(power_button_index, (dgr_more_to_come ? DGR_MSGTYP_UPDATE_MORE_TO_COME : DGR_MSGTYP_UPDATE_DIRECT), dgr_item, dgr_value);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user