v5.10.0g - Alexa 2nd Gen support

5.10.0g
 * Add 2nd Gen Alexa support to Wemo emulation discovery (#1357,
#1450)
This commit is contained in:
arendst 2017-12-30 12:47:19 +01:00
parent 85d75ffc95
commit 24a6960749
4 changed files with 25 additions and 90 deletions

View File

@ -1,7 +1,7 @@
## Sonoff-Tasmota ## Sonoff-Tasmota
Provide ESP8266 based Sonoff by [iTead Studio](https://www.itead.cc/) and ElectroDragon IoT Relay with Serial, Web and MQTT control allowing 'Over the Air' or OTA firmware updates using Arduino IDE. Provide ESP8266 based Sonoff by [iTead Studio](https://www.itead.cc/) and ElectroDragon IoT Relay with Serial, Web and MQTT control allowing 'Over the Air' or OTA firmware updates using Arduino IDE.
Current version is **5.10.0f** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_releasenotes.ino) for change information. Current version is **5.10.0g** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_releasenotes.ino) for change information.
### ATTENTION All versions ### ATTENTION All versions

View File

@ -1,4 +1,7 @@
/* 5.10.0f /* 5.10.0g
* Add 2nd Gen Alexa support to Wemo emulation discovery (#1357, #1450)
*
* 5.10.0f
* Differentiate between JSON text defines and other text defines to allow for English JSON while using different locale (#1449) * Differentiate between JSON text defines and other text defines to allow for English JSON while using different locale (#1449)
* Fix display of build date and time in non-english locale (#1465) * Fix display of build date and time in non-english locale (#1465)
* Add define for additional number of WS2812 schemes (#1463) * Add define for additional number of WS2812 schemes (#1463)

View File

@ -25,8 +25,8 @@
- Select IDE Tools - Flash Size: "1M (no SPIFFS)" - Select IDE Tools - Flash Size: "1M (no SPIFFS)"
====================================================*/ ====================================================*/
#define VERSION 0x050A0006 #define VERSION 0x050A0007
#define VERSION_STRING "5.10.0f" // Would be great to have a macro that fills this from VERSION ... #define VERSION_STRING "5.10.0g" // Would be great to have a macro that fills this from VERSION ...
// Location specific includes // Location specific includes
#include "sonoff.h" // Enumaration used in user_config.h #include "sonoff.h" // Enumaration used in user_config.h

View File

@ -220,14 +220,18 @@ void PollUdp()
// AddLog_P(LOG_LEVEL_DEBUG_MORE, PSTR("UDP: M-SEARCH Packet received")); // AddLog_P(LOG_LEVEL_DEBUG_MORE, PSTR("UDP: M-SEARCH Packet received"));
// AddLog_P(LOG_LEVEL_DEBUG_MORE, request.c_str()); // AddLog_P(LOG_LEVEL_DEBUG_MORE, request.c_str());
if ((EMUL_WEMO == Settings.flag2.emulation) && (request.indexOf(F("urn:belkin:device:**")) > 0)) { if ((EMUL_WEMO == Settings.flag2.emulation) &&
((request.indexOf(F("urn:belkin:device:**")) > 0) ||
(request.indexOf(F("upnp:rootdevice")) > 0) || // Needed by 2nd generation Echo
(request.indexOf(F("ssdpsearch:all")) > 0) ||
(request.indexOf(F("ssdp:all")) > 0))) {
WemoRespondToMSearch(); WemoRespondToMSearch();
} }
else if ((EMUL_HUE == Settings.flag2.emulation) && else if ((EMUL_HUE == Settings.flag2.emulation) &&
((request.indexOf(F("st:urn:schemas-upnp-org:device:basic:1")) > 0) || ((request.indexOf(F("urn:schemas-upnp-org:device:basic:1")) > 0) ||
(request.indexOf(F("st:upnp:rootdevice")) > 0) || (request.indexOf(F("upnp:rootdevice")) > 0) ||
(request.indexOf(F("st:ssdpsearch:all")) > 0) || (request.indexOf(F("ssdpsearch:all")) > 0) ||
(request.indexOf(F("st:ssdp:all")) > 0))) { (request.indexOf(F("ssdp:all")) > 0))) {
HueRespondToMSearch(); HueRespondToMSearch();
} }
} }
@ -241,42 +245,7 @@ void PollUdp()
\*********************************************************************************************/ \*********************************************************************************************/
const char WEMO_EVENTSERVICE_XML[] PROGMEM = const char WEMO_EVENTSERVICE_XML[] PROGMEM =
/*
// Original
"<?scpd xmlns=\"urn:Belkin:service-1-0\"?>"
"<actionList>"
"<action>"
"<name>SetBinaryState</name>"
"<argumentList>"
"<argument>"
"<retval/>"
"<name>BinaryState</name>"
"<relatedStateVariable>BinaryState</relatedStateVariable>"
"<direction>in</direction>"
"</argument>"
"</argumentList>"
"<serviceStateTable>"
"<stateVariable sendEvents=\"yes\">"
"<name>BinaryState</name>"
"<dataType>Boolean</dataType>"
"<defaultValue>0</defaultValue>"
"</stateVariable>"
"<stateVariable sendEvents=\"yes\">"
"<name>level</name>"
"<dataType>string</dataType>"
"<defaultValue>0</defaultValue>"
"</stateVariable>"
"</serviceStateTable>"
"</action>"
"</scpd>\r\n"
"\r\n";
*/
/*
// XosePerez version 20171108 - v2.3.0
"<?xml version=\"1.0\"?>"
"<scpd xmlns=\"urn:Belkin:service-1-0\">" "<scpd xmlns=\"urn:Belkin:service-1-0\">"
"<specVersion><major>1</major><minor>0</minor></specVersion>"
"<actionList>" "<actionList>"
"<action>" "<action>"
"<name>SetBinaryState</name>" "<name>SetBinaryState</name>"
@ -301,29 +270,6 @@ const char WEMO_EVENTSERVICE_XML[] PROGMEM =
"</argumentList>" "</argumentList>"
"</action>" "</action>"
"</actionList>" "</actionList>"
"<serviceStateTable>"
"<stateVariable sendEvents=\"yes\">"
"<name>BinaryState</name>"
"<dataType>Boolean</dataType>"
"<defaultValue>0</defaultValue>"
"</stateVariable>"
"</serviceStateTable>"
"</scpd>";
*/
// Reloxx13 from #1357
"<?scpd xmlns=\"urn:Belkin:service-1-0\"?>"
"<actionList>"
"<action>"
"<name>SetBinaryState</name>"
"<argumentList>"
"<argument>"
"<retval/>"
"<name>BinaryState</name>"
"<relatedStateVariable>BinaryState</relatedStateVariable>"
"<direction>in</direction>"
"</argument>"
"</argumentList>"
"<serviceStateTable>" "<serviceStateTable>"
"<stateVariable sendEvents=\"yes\">" "<stateVariable sendEvents=\"yes\">"
"<name>BinaryState</name>" "<name>BinaryState</name>"
@ -336,19 +282,6 @@ const char WEMO_EVENTSERVICE_XML[] PROGMEM =
"<defaultValue>0</defaultValue>" "<defaultValue>0</defaultValue>"
"</stateVariable>" "</stateVariable>"
"</serviceStateTable>" "</serviceStateTable>"
"</action>"
"<action>"
"<name>GetBinaryState</name>"
"<argumentList>"
"<argument>"
"<retval/>"
"<name>BinaryState</name>"
"<relatedStateVariable>BinaryState</relatedStateVariable>"
"<direction>out</direction>"
"</argument>"
"</argumentList>"
"</action>"
"</actionList>"
"</scpd>\r\n" "</scpd>\r\n"
"\r\n"; "\r\n";
@ -360,8 +293,7 @@ const char WEMO_RESPONSE_STATE_SOAP[] PROGMEM =
"<BinaryState>{x1</BinaryState>" "<BinaryState>{x1</BinaryState>"
"</u:SetBinaryStateResponse>" "</u:SetBinaryStateResponse>"
"</s:Body>" "</s:Body>"
"</s:Envelope>\r\n" "</s:Envelope>\r\n";
"\r\n";
const char WEMO_SETUP_XML[] PROGMEM = const char WEMO_SETUP_XML[] PROGMEM =
"<?xml version=\"1.0\"?>" "<?xml version=\"1.0\"?>"
@ -370,7 +302,7 @@ const char WEMO_SETUP_XML[] PROGMEM =
"<deviceType>urn:Belkin:device:controllee:1</deviceType>" "<deviceType>urn:Belkin:device:controllee:1</deviceType>"
"<friendlyName>{x1</friendlyName>" "<friendlyName>{x1</friendlyName>"
"<manufacturer>Belkin International Inc.</manufacturer>" "<manufacturer>Belkin International Inc.</manufacturer>"
"<modelName>Sonoff Socket</modelName>" "<modelName>Socket</modelName>"
"<modelNumber>3.1415</modelNumber>" "<modelNumber>3.1415</modelNumber>"
"<UDN>uuid:{x2</UDN>" "<UDN>uuid:{x2</UDN>"
"<serialNumber>{x3</serialNumber>" "<serialNumber>{x3</serialNumber>"
@ -385,7 +317,7 @@ const char WEMO_SETUP_XML[] PROGMEM =
"</service>" "</service>"
"</serviceList>" "</serviceList>"
"</device>" "</device>"
"</root>"; "</root>\r\n";
/********************************************************************************************/ /********************************************************************************************/