Check no hold retain flag on hold action sending

This commit is contained in:
netpok 2019-02-21 21:28:35 +01:00
parent b3adab4097
commit 6cbfb0308a
1 changed files with 2 additions and 2 deletions

View File

@ -1434,10 +1434,10 @@ bool SendKey(uint8_t key, uint8_t device, uint8_t state)
}
#ifdef USE_DOMOTICZ
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
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
result = !Settings.flag3.button_switch_force_local;
} else {