diff --git a/tasmota/support_tasmota.ino b/tasmota/support_tasmota.ino index da342868a..d8bc55e98 100644 --- a/tasmota/support_tasmota.ino +++ b/tasmota/support_tasmota.ino @@ -488,12 +488,16 @@ bool SendKey(uint32_t key, uint32_t device, uint32_t state) Response_P(PSTR("{\"%s%d\":{\"State\":%d}}"), (key) ? "Switch" : "Button", device, state); result = XdrvRulesProcess(); } +#ifdef USE_PWM_DIMMER + if (PWM_DIMMER == my_module_type && !result) { +#endif // USE_PWM_DIMMER int32_t payload_save = XdrvMailbox.payload; XdrvMailbox.payload = device_save << 24 | key << 16 | state << 8 | device; XdrvCall(FUNC_ANY_KEY); XdrvMailbox.payload = payload_save; #ifdef USE_PWM_DIMMER - if (PWM_DIMMER == my_module_type) result = true; + result = true; + } #endif // USE_PWM_DIMMER return result; } diff --git a/tasmota/xdrv_35_pwm_dimmer.ino b/tasmota/xdrv_35_pwm_dimmer.ino index 67d7e2149..744e5a29b 100644 --- a/tasmota/xdrv_35_pwm_dimmer.ino +++ b/tasmota/xdrv_35_pwm_dimmer.ino @@ -108,7 +108,7 @@ void PWMModulePreInit(void) PWMDimmerSetPoweredOffLed(); // The relay initializes to on. If the power is supposed to be off, turn the relay off. - if (!power && PinUsed(GPIO_REL1)) digitalWrite(Pin(GPIO_REL1), bitRead(rel_inverted, 0) ? 1 : 0); +// if (!power && PinUsed(GPIO_REL1)) digitalWrite(Pin(GPIO_REL1), bitRead(rel_inverted, 0) ? 1 : 0); #ifdef USE_PWM_DIMMER_REMOTE // If remote device mode is enabled, set the device group count to the number of buttons @@ -546,7 +546,6 @@ void PWMDimmerHandleButton(uint32_t button_index, bool pressed) else SendDeviceGroupMessage(power_button_index, DGR_MSGTYP_UPDATE, DGR_ITEM_POWER, new_power); #endif // USE_DEVICE_GROUPS - #ifdef USE_PWM_DIMMER_REMOTE if (active_remote_pwm_dimmer) active_remote_pwm_dimmer->power_button_increases_bri = (power_on_bri < 128);