correct LYWSD02 not displayed with HM10

#412
This commit is contained in:
Florian committed 2019-06-21 21:51:31 +02:00
1 parent de93fd0da0
commit bc847684f9
1 file changed
+2 -2
+2 -2
View File
@@ -309,7 +309,6 @@ vector<BLEdevice> devices;
BLEdata.set("servicedata", (char *)Service_data.c_str()); BLEdata.set("servicedata", (char *)Service_data.c_str());
#endif #endif
pub((char *)topic.c_str(),BLEdata); pub((char *)topic.c_str(),BLEdata);
if (strcmp(d[4].extract, "fe95") == 0) {
int pos = -1; int pos = -1;
pos = strpos(d[5].extract,"209800"); pos = strpos(d[5].extract,"209800");
if (pos != -1) { if (pos != -1) {
@@ -321,6 +320,7 @@ vector<BLEdevice> devices;
} }
pos = -1; pos = -1;
pos = strpos(d[5].extract,"20aa01"); pos = strpos(d[5].extract,"20aa01");
//example "servicedata":"5020aa0194dfaa33342d580d1004e3002c02"
if (pos != -1){ if (pos != -1){
trc("mi jia data reading"); trc("mi jia data reading");
#ifdef ZmqttDiscovery #ifdef ZmqttDiscovery
@@ -330,6 +330,7 @@ vector<BLEdevice> devices;
} }
pos = -1; pos = -1;
pos = strpos(d[5].extract,"205b04"); pos = strpos(d[5].extract,"205b04");
//example "servicedata":"141695fe70205b0461298882c8593f09061002d002"
if (pos != -1){ if (pos != -1){
trc("LYWSD02 data reading"); trc("LYWSD02 data reading");
#ifdef ZmqttDiscovery #ifdef ZmqttDiscovery
@@ -350,7 +351,6 @@ vector<BLEdevice> devices;
} }
} }
} }
}
returnedString = ""; //init data string returnedString = ""; //init data string
return false; return false;
} }