mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-28 21:26:33 +00:00
Fix Wemo emulation
Fix Wemo emulation to select the first relay when more than one relay is present (#3657)
This commit is contained in:
parent
a60876378f
commit
0ac8c73938
@ -2,6 +2,7 @@
|
||||
* Fix possible ambiguity on command parameters if StateText contains numbers only (#3656)
|
||||
* Fix possible exception due to buffer overflow (#3659)
|
||||
* Add Wifi channel number to state message (#3664)
|
||||
* Fix Wemo emulation to select the first relay when more than one relay is present (#3657)
|
||||
*
|
||||
* 6.2.0 20180901
|
||||
* Allow user override of define MAX_RULE_VARS and MAX_RULE_TIMERS (#3561)
|
||||
|
@ -386,12 +386,18 @@ void HandleUpnpEvent()
|
||||
String state_xml = FPSTR(WEMO_RESPONSE_STATE_SOAP);
|
||||
//differentiate get and set state
|
||||
if (request.indexOf(F("SetBinaryState")) > 0) {
|
||||
uint8_t power = POWER_TOGGLE;
|
||||
if (request.indexOf(F("State>1</Binary")) > 0) {
|
||||
ExecuteCommandPower(devices_present, POWER_ON, SRC_WEMO);
|
||||
power = POWER_ON
|
||||
}
|
||||
else if (request.indexOf(F("State>0</Binary")) > 0) {
|
||||
ExecuteCommandPower(devices_present, POWER_OFF, SRC_WEMO);
|
||||
power = POWER_OFF;
|
||||
}
|
||||
if (power != POWER_TOGGLE) {
|
||||
uint8_t device = (light_type) ? devices_present : 1; // Select either a configured light or relay1
|
||||
ExecuteCommandPower(device, power, SRC_WEMO);
|
||||
}
|
||||
|
||||
}
|
||||
else if(request.indexOf(F("GetBinaryState")) > 0){
|
||||
state_xml.replace(F("Set"), F("Get"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user