Skip to content

Commit

Permalink
(2.3.4) Fix light strip device type (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aircoookie committed Feb 15, 2019
1 parent db991ea commit 4158bf6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Espalexa
version=2.3.3
version=2.3.4
author=Christian Schwinne
maintainer=Christian Schwinne
sentence=Library to control an ESP module with the Alexa voice assistant
Expand Down
20 changes: 8 additions & 12 deletions src/Espalexa.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/
/*
* @title Espalexa library
* @version 2.3.3
* @version 2.3.4
* @author Christian Schwinne
* @license MIT
* @contributors d-999
Expand Down Expand Up @@ -46,7 +46,7 @@
#include <WiFiUdp.h>

#ifdef ESPALEXA_DEBUG
#pragma message "Espalexa 2.3.3 debug mode"
#pragma message "Espalexa 2.3.4 debug mode"
#define EA_DEBUG(x) Serial.print (x)
#define EA_DEBUGLN(x) Serial.println (x)
#else
Expand Down Expand Up @@ -80,6 +80,7 @@ class Espalexa {
String escapedMac=""; //lowercase mac address

//private member functions
//device JSON string: color+temperature device emulates LCT015, dimmable device LWB010, (TODO: on/off Plug 01, color temperature device LWT010, color device LST001)
String deviceJsonString(uint8_t deviceId)
{
if (deviceId < 1 || deviceId > currentDeviceCount) return "{}"; //error
Expand All @@ -89,7 +90,9 @@ class Espalexa {
json += "\",\"manufacturername\":\"OpenSource\",\"swversion\":\"0.1\",\"name\":\"";
json += dev->getName();
json += "\",\"uniqueid\":\""+ WiFi.macAddress() +"-"+ (deviceId+1) ;
json += "\",\"modelid\":\"LST001\",\"state\":{\"on\":";
json += "\",\"modelid\":\"";
json += dev->isColorDevice() ? "LCT015" : "LWB010";
json += "\",\"state\":{\"on\":";
json += boolString(dev->getValue()) +",\"bri\":"+ (String)(dev->getLastValue()-1) ;
if (dev->isColorDevice())
{
Expand All @@ -112,7 +115,7 @@ class Espalexa {
}
res += "\r\nFree Heap: " + (String)ESP.getFreeHeap();
res += "\r\nUptime: " + (String)millis();
res += "\r\n\r\nEspalexa library v2.3.3 by Christian Schwinne 2019";
res += "\r\n\r\nEspalexa library v2.3.4 by Christian Schwinne 2019";
server->send(200, "text/plain", res);
}

Expand Down Expand Up @@ -146,7 +149,7 @@ class Espalexa {
"<URLBase>http://"+ String(s) +":80/</URLBase>"
"<device>"
"<deviceType>urn:schemas-upnp-org:device:Basic:1</deviceType>"
"<friendlyName>Philips hue ("+ String(s) +")</friendlyName>"
"<friendlyName>Espalexa ("+ String(s) +")</friendlyName>"
"<manufacturer>Royal Philips Electronics</manufacturer>"
"<manufacturerURL>http://www.philips.com</manufacturerURL>"
"<modelDescription>Philips hue Personal Wireless Lighting</modelDescription>"
Expand All @@ -164,13 +167,6 @@ class Espalexa {
" <depth>24</depth>"
" <url>hue_logo_0.png</url>"
" </icon>"
" <icon>"
" <mimetype>image/png</mimetype>"
" <height>120</height>"
" <width>120</width>"
" <depth>24</depth>"
" <url>hue_logo_3.png</url>"
" </icon>"
"</iconList>"
"</device>"
"</root>";
Expand Down

0 comments on commit 4158bf6

Please sign in to comment.