mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
Add extra check for empty results in discovery (#304)
This commit is contained in:
parent
d48644e16a
commit
6168f7ef34
@ -123,7 +123,7 @@ WeMoNG.prototype.start = function start() {
|
|||||||
request.get(location.href, function(err, res, xml) {
|
request.get(location.href, function(err, res, xml) {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
xml2js.parseString(xml, function(err, json) {
|
xml2js.parseString(xml, function(err, json) {
|
||||||
if (!err && json) {
|
if (!err && json && json.root) {
|
||||||
var device = { ip: location.hostname, port: location.port };
|
var device = { ip: location.hostname, port: location.port };
|
||||||
for (var key in json.root.device[0]) {
|
for (var key in json.root.device[0]) {
|
||||||
device[key] = json.root.device[0][key][0];
|
device[key] = json.root.device[0][key][0];
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "node-red-node-wemo",
|
"name": "node-red-node-wemo",
|
||||||
"version": "0.1.11",
|
"version": "0.1.12",
|
||||||
"description": "Input and Output nodes for Belkin WeMo devices",
|
"description": "Input and Output nodes for Belkin WeMo devices",
|
||||||
"repository": "https://github.com/node-red/node-red-nodes/tree/master/hardware",
|
"repository": "https://github.com/node-red/node-red-nodes/tree/master/hardware",
|
||||||
"main": "WeMoNG.js",
|
"main": "WeMoNG.js",
|
||||||
|
Loading…
Reference in New Issue
Block a user