mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-30 14:16:32 +00:00
Merge pull request #5299 from netpok/no-hold-retain
Allow non-retained hold messages while using button or switchretain
This commit is contained in:
commit
70b33ba18a
@ -75,7 +75,7 @@ typedef union { // Restricted by MISRA-C Rule 18.4 bu
|
|||||||
uint32_t hass_tele_on_power : 1; // bit 9 (v6.3.0.13)
|
uint32_t hass_tele_on_power : 1; // bit 9 (v6.3.0.13)
|
||||||
uint32_t sleep_normal : 1; // bit 10 (v6.3.0.15) - SetOption60 - Enable normal sleep instead of dynamic sleep
|
uint32_t sleep_normal : 1; // bit 10 (v6.3.0.15) - SetOption60 - Enable normal sleep instead of dynamic sleep
|
||||||
uint32_t button_switch_force_local : 1;// bit 11 (v6.3.0.16) - SetOption61 - Force local operation when button/switch topic is set
|
uint32_t button_switch_force_local : 1;// bit 11 (v6.3.0.16) - SetOption61 - Force local operation when button/switch topic is set
|
||||||
uint32_t spare12 : 1;
|
uint32_t no_hold_retain : 1; // bit 12 (v6.4.1.19) - SetOption62 - Don't use retain flag on HOLD messages
|
||||||
uint32_t spare13 : 1;
|
uint32_t spare13 : 1;
|
||||||
uint32_t spare14 : 1;
|
uint32_t spare14 : 1;
|
||||||
uint32_t spare15 : 1;
|
uint32_t spare15 : 1;
|
||||||
|
@ -1434,10 +1434,10 @@ bool SendKey(uint8_t key, uint8_t device, uint8_t state)
|
|||||||
}
|
}
|
||||||
#ifdef USE_DOMOTICZ
|
#ifdef USE_DOMOTICZ
|
||||||
if (!(DomoticzSendKey(key, device, state, strlen(mqtt_data)))) {
|
if (!(DomoticzSendKey(key, device, state, strlen(mqtt_data)))) {
|
||||||
MqttPublishDirect(stopic, (key) ? Settings.flag.mqtt_switch_retain : Settings.flag.mqtt_button_retain);
|
MqttPublishDirect(stopic, ((key) ? Settings.flag.mqtt_switch_retain : Settings.flag.mqtt_button_retain) && (state != 3 || !Settings.flag3.no_hold_retain));
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
MqttPublishDirect(stopic, (key) ? Settings.flag.mqtt_switch_retain : Settings.flag.mqtt_button_retain);
|
MqttPublishDirect(stopic, ((key) ? Settings.flag.mqtt_switch_retain : Settings.flag.mqtt_button_retain) && (state != 3 || !Settings.flag3.no_hold_retain));
|
||||||
#endif // USE_DOMOTICZ
|
#endif // USE_DOMOTICZ
|
||||||
result = !Settings.flag3.button_switch_force_local;
|
result = !Settings.flag3.button_switch_force_local;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user