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