question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Example returns same bridge twice

See original GitHub issue

Not a major issue from an API-consumer perspective, but it might indicate an error internally.

When I run this:

var hue = require("node-hue-api"),
	timeout = 2000; // 2 seconds

var displayBridges = function(bridge) {
	console.log("Hue Bridges Found: " + JSON.stringify(bridge));
};

hue.upnpSearch(timeout).then(displayBridges).done();

I get this output:

Hue Bridges Found: [{"id":"001789ffde3890ac","ipaddress":"172.16.0.64"}]
Hue Bridges Found: [{"id":"001789ffde3890ac","ipaddress":"172.16.0.64"}]

Note how the callback is hit twice.

My yarn.lock:

...
node-hue-api@^2.4.2:
  version "2.4.2"
  resolved "https://registry.yarnpkg.com/node-hue-api/-/node-hue-api-2.4.2.tgz#f721aba415a6c4a8d0b4c2af0ab36939f0ab5cb7"
  dependencies:
    axios "~0.15.3"
    deep-extend "~0.4.0"
    q "~1.4"
    traits "~0.4.0"
    xml2js "~0.4"
...

I am on macOS.

$ node --version 
v9.3.0

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
peter-murraycommented, Jan 12, 2018

Thanks for filing the issue with enough details so I could attempt to recreate.

I cannot get the library to reproduce your results. I am also on macOS, and tested under Node.js 8, 9.4.0 and 9.3.0…

The only difference is that I don’t use yarn, but the dependencies are the latest resolved from the npm registry.

0reactions
cKhoffcommented, Feb 4, 2018

Hi there, thank u for ur fast response 👍 My setup should be similar tu urs, i guess and the brigde has a static ip and running in my local subnet.

environment setup:

OS

Darwin Christians-MacBook.fritz.box 17.3.0 Darwin Kernel Version 17.3.0: Thu Nov 9 18:09:22 PST 2017; root:xnu-4570.31.3~1/RELEASE_X86_64 `x86_64

Node

v9.4.0|v8.9.4

Solved 4 me

But finally the fault was behind the machine… I figured out that u offer the Promise # AND the functional way 🥇 in addiction to @njlr i just c&p the example and was to greedy…

Still got at lot 2 learn 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Leonard Euler's Solution to the Konigsberg Bridge Problem
Basically, the handshaking lemma states that each bridge is counted twice, once for each landmass to which it is attached. In Paragraph 17,...
Read more >
Konigsberg Bridge Problem - YouTube
An introduction to networks and the Konigsberg Bridge Problem.
Read more >
The 7 Bridges of Königsberg - beanz Magazine
Euler proved the number of bridges must be an even number, for example, six bridges instead of seven, if you want to walk...
Read more >
Activity: The Seven Bridges of Königsberg - Math is Fun
Simplifying It​​ Let us label them A, B, C and D: To "visit each part of the town" you should visit the points...
Read more >
Königsberg bridge problem | mathematics - Britannica
According to folklore, the question arose of whether a citizen could take a walk through the town in such a way that each...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found