mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-23 18:56:38 +00:00
Fix invalid response
Fix invalid response using more than 4 switches and domoticz
This commit is contained in:
parent
a489b4a44a
commit
5372cdf511
@ -1,4 +1,5 @@
|
||||
/* 6.1.0a
|
||||
* Fix invalid response using more than 4 switches and domoticz
|
||||
* Update sensor drivers to provide instant results
|
||||
* Add read sensor retry to DS18B20, DS18x20, DHT, SHT1X and HTU21
|
||||
* Change SHT1x driver to provide better instant results
|
||||
|
@ -271,14 +271,17 @@ boolean DomoticzCommand()
|
||||
|
||||
boolean DomoticzSendKey(byte key, byte device, byte state, byte svalflg)
|
||||
{
|
||||
if ((Settings.domoticz_key_idx[device -1] || Settings.domoticz_switch_idx[device -1]) && (svalflg)) {
|
||||
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"command\":\"switchlight\",\"idx\":%d,\"switchcmd\":\"%s\"}"),
|
||||
(key) ? Settings.domoticz_switch_idx[device -1] : Settings.domoticz_key_idx[device -1], (state) ? (2 == state) ? "Toggle" : "On" : "Off");
|
||||
MqttPublish(domoticz_in_topic);
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
boolean result = 0;
|
||||
|
||||
if (device <= MAX_DOMOTICZ_IDX) {
|
||||
if ((Settings.domoticz_key_idx[device -1] || Settings.domoticz_switch_idx[device -1]) && (svalflg)) {
|
||||
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"command\":\"switchlight\",\"idx\":%d,\"switchcmd\":\"%s\"}"),
|
||||
(key) ? Settings.domoticz_switch_idx[device -1] : Settings.domoticz_key_idx[device -1], (state) ? (2 == state) ? "Toggle" : "On" : "Off");
|
||||
MqttPublish(domoticz_in_topic);
|
||||
result = 1;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/*********************************************************************************************\
|
||||
|
Loading…
x
Reference in New Issue
Block a user