peter-murray / node-hue-api

Node.js Library for interacting with the Philips Hue Bridge and Lights
Apache License 2.0
1.19k stars 145 forks source link

Issues with module, most tests failing #103

Closed mattfelsen closed 7 years ago

mattfelsen commented 7 years ago

Hi! I was excited to try out this module, but I'm having some trouble getting things working. I have the Bridge plugged into my wifi router via ethernet, and I can use the app to control the bulbs, so I think things are set up on that end. Both the promise and callback style of finding a bridge wasn't working, so I tried running the test suite. My full log is below...let me know if you've got any thoughts! Thanks!

$ node -v
v6.3.1

$ mkdir hue
$ cd hue/
$ npm install node-hue-api
└─┬ node-hue-api@2.3.0 
  ├─┬ axios@0.8.1 
  │ └─┬ follow-redirects@0.0.7 
  │   ├─┬ debug@2.6.0 
  │   │ └── ms@0.7.2 
  │   └── stream-consume@0.1.0 
  ├── deep-extend@0.4.1 
  ├── q@1.4.1 
  ├── traits@0.4.0 
  └─┬ xml2js@0.4.17 
    ├── sax@1.2.1 
    └─┬ xmlbuilder@4.2.1 
      └── lodash@4.17.4 

$ cd node_modules/node-hue-api/
$ npm install

npm WARN deprecated jade@0.26.3: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated graceful-fs@2.0.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
node-hue-api@2.3.0 /Users/matt/Documents/Code/Projects/magicians/magicians-scripts/hue/node_modules/node-hue-api
├─┬ axios@0.8.1 
│ └─┬ follow-redirects@0.0.7 
│   ├─┬ debug@2.6.0 
│   │ └── ms@0.7.2 
│   └── stream-consume@0.1.0 
├─┬ chai@3.4.1 
│ ├── assertion-error@1.0.2 
│ ├─┬ deep-eql@0.1.3 
│ │ └── type-detect@0.1.1 
│ └── type-detect@1.0.0 
├── deep-extend@0.4.1 
├─┬ mocha@2.3.4 
│ ├── commander@2.3.0 
│ ├─┬ debug@2.2.0 
│ │ └── ms@0.7.1 
│ ├── diff@1.4.0 
│ ├── escape-string-regexp@1.0.2 
│ ├─┬ glob@3.2.3 
│ │ ├── graceful-fs@2.0.3 
│ │ ├── inherits@2.0.3 
│ │ └─┬ minimatch@0.2.14 
│ │   ├── lru-cache@2.7.3 
│ │   └── sigmund@1.0.1 
│ ├── growl@1.8.1 
│ ├─┬ jade@0.26.3 
│ │ ├── commander@0.6.1 
│ │ └── mkdirp@0.3.0 
│ ├─┬ mkdirp@0.5.0 
│ │ └── minimist@0.0.8 
│ └── supports-color@1.2.0 
├── q@1.4.1 
├── semver@5.0.3 
├── traits@0.4.0 
└─┬ xml2js@0.4.17 
  ├── sax@1.2.1 
  └─┬ xmlbuilder@4.2.1 
    └── lodash@4.17.4 

$ npm test

> node-hue-api@2.3.0 test /Users/matt/Documents/Code/Projects/magicians/magicians-scripts/hue/node_modules/node-hue-api
> mocha test

  - Hue API #creation should have a default timeout
  - Hue API #creation should have a non-default timeout if specified
  1) Hue API #config using #promise
  2) Hue API #config using #callback
  3) Hue API version #version using #promise
  4) Hue API version #version using #callback
  5) Hue API version #getVersion using #promise
  6) Hue API version #getVersion using #callback
  7) Hue API description #description() using #promise
  8) Hue API description #description() using #callback
  9) Hue API description #getDescription() using #promise
  10) Hue API description #getDescription() using #callback
  11) Hue API full state #fullState() using #promise
  12) Hue API full state #fullState() using #callback
  13) Hue API full state #getFullState() using #promise
  14) Hue API full state #getFullState() using #callback
  15) Hue API info #getTimezones() using #promise
  16) Hue API info #getTimezones() using #callback
  17) Hue API info #timezones() using #promise
  18) Hue API info #timezones() using #callback
  19) Hue API #lightStatus #promise should get status of light
  20) Hue API #lightStatus #callback should get status of light
  21) Hue API group tests #groups using #promise should retrieve all groups
  22) Hue API group tests #groups using #callback should retrieve all groups
  23) Hue API group tests #luminaires using #promise
  24) Hue API group tests #luminaires using #callback
  25) Hue API group tests #lightSources using #promise
  26) Hue API group tests #lightSources using #callback
  27) Hue API group tests #lightGroups using #promise
  28) Hue API group tests #lightGroups using #callback
  29) Hue API group tests #getGroup using #promise should obtain 'All Lights' group details
  30) Hue API group tests #getGroup using #promise should fail for a group id that does not exist
  ․ Hue API group tests #getGroup using #promise should fail for group Id 999: 3ms
  31) Hue API group tests #getGroup using #callback should obtain 'All Lights' group details
  32) Hue API group tests #getGroup using #callback should fail for a group id that does not exist
  ․ Hue API group tests #getGroup using #callback should fail for group Id 999: 2ms
  33) Hue API group tests #createGroup #deleteGroup should create a group and then delete it using #promise
  34) Hue API group tests #createGroup #deleteGroup should create a group and then delete it using #callback
  35) Hue API group tests #updateGroup "before each" hook for "should update only the name of a group"
  36) Hue API group tests #updateGroup "after each" hook
  37) Hue API group tests #setGroupLightState using #promise
  38) Hue API group tests #setGroupLightState using #callback
    Hue API group tests #updateGroup should fail on invalid group id: {"message":"The group id '99' cannot be modified on this Hue Bridge.","type":0}
  ․ Hue API group tests #updateGroup should fail on invalid group id: 2ms
  39) Hue API group tests #_getGroupLightsByType should work for group 0
  40) Hue API #lights() #promise should find some
  41) Hue API #lights() #callback should find some lights
  42) Hue API #getLights() #promise should find some
  43) Hue API #getLights() #callback should find some lights
  ․ #LightState creation should create an empty object: 1ms
  ․ #LightState set single state on #on #on with no value: 1ms
  ․ #LightState set single state on #on set to true: 0ms
  ․ #LightState set single state on #on set to false: 0ms
  ․ #LightState set single state on #off should set on property to false: 0ms
  ․ #LightState set single state effect #effect should accept 'none': 1ms
  ․ #LightState set single state effect #effect should accept 'colorloop': 0ms
  ․ #LightState set single state effect #effect should deal with an invalid value and set 'none': 0ms
  ․ #LightState set single state effect #effect should set effect to none if no parameter provided: 0ms
  ․ #LightState set single state effect #colorLoop should: 0ms
  ․ #LightState set single state effect #colourLoop should: 0ms
  ․ #LightState set single state effect #effectColorLoop should: 0ms
  ․ #LightState set single state effect #effectColourLoop should: 0ms
  ․ #LightState set single state alert #alert should be a short when not specified: 1ms
  ․ #LightState set single state alert #alert should be short when false: 0ms
  ․ #LightState set single state alert #alert should be long when true: 0ms
  ․ #LightState set single state alert #alertLong should set a long alert: 0ms
  ․ #LightState set single state alert #longAlert should set a long alert: 0ms
  ․ #LightState set single state alert #alertShort should set a short alert: 0ms
  ․ #LightState set single state alert #shortAlert should set a short alert: 0ms
  ․ #LightState set single state bri #bri should set brightness to 254: 1ms
  ․ #LightState set single state bri #bri should set brightness to 0: 0ms
  ․ #LightState set single state bri #bri should set brightness to 10: 1ms
  ․ #LightState set single state bri #bri should respect min boundary: 0ms
  ․ #LightState set single state bri #brighness 100% should set brightness to 254: 0ms
  ․ #LightState set single state bri #brighness 0% should set brightness to 0: 0ms
  ․ #LightState set single state bri #brighness 50% should set brightness to 155: 0ms
  ․ #LightState set single state bri #brighness should convert negative to zero: 0ms
  ․ #LightState set single state hue #hue should set to zero if not specified: 1ms
  ․ #LightState set single state hue #hue should respect minimum boundary: 0ms
  ․ #LightState set single state hue #hue should respect maximum boundary: 0ms
  ․ #LightState set single state hue #hue should set to 1: 1ms
  ․ #LightState set single state hue #hue should set to 15000: 0ms
  ․ #LightState set single state sat #sat should set to 0: 1ms
  ․ #LightState set single state sat #sat should set to 255: 0ms
  ․ #LightState set single state sat #sat should set to 125: 1ms
  ․ #LightState set single state sat #sat should respect min boundary: 0ms
  ․ #LightState set single state sat #sat should respect max boundary: 0ms
  ․ #LightState set single state sat #sat should set to 0 if not specified: 1ms
  ․ #LightState set single state sat #saturation should set 0%: 1ms
  ․ #LightState set single state sat #saturation should set 100%: 0ms
  ․ #LightState set single state sat #saturation should set 50%: 0ms
  ․ #LightState set single state sat #saturation should convert -100% to 0: 0ms
  ․ #LightState set single state sat #saturation should convert 200% to 255: 0ms
  ․ #LightState set single state #xy should set (0,0): 3ms
  ․ #LightState set single state #xy should set (0, 1): 0ms
  ․ #LightState set single state #xy should set (1, 1): 1ms
  ․ #LightState set single state #xy should set (0.254, 0.5): 1ms
  ․ #LightState set single state #xy should support an array of [x, y]: 0ms
  ․ #LightState set single state #xy x value boundaries should convert -1 to 0: 0ms
  ․ #LightState set single state #xy x value boundaries should convert 1.1 to 1: 2ms
  ․ #LightState set single state #xy y value boundaries should convert -10.5 to 0: 1ms
  ․ #LightState set single state #xy y value boundaries should convert 10.581 to 1: 1ms
  ․ #LightState set single state ct #ct should set 153 (6500K): 1ms
  ․ #LightState set single state ct #ct should set 500 (2000K): 0ms
  ․ #LightState set single state ct #ct should set 212: 0ms
  ․ #LightState set single state ct #ct should convert 0 to 153: 0ms
  ․ #LightState set single state ct #ct should convert 600 to 500: 0ms
  ․ #LightState set single state ct #ct should set 153 if no parameters provided: 0ms
  ․ #LightState set single state ct #colorTemperature should set 153: 0ms
  ․ #LightState set single state ct #colourTemperature should set 153: 0ms
  ․ #LightState set single state ct #colorTemp should set 153: 0ms
  ․ #LightState set single state ct #colorTemp should set 300: 0ms
  ․ #LightState set single state ct #colourTemp should set 153: 0ms
  ․ #LightState set single state ct #colourTemp should set 220: 0ms
  ․ #LightState set single state transitiontime #transitiontime should set 0: 1ms
  ․ #LightState set single state transitiontime #transitiontime should set 4: 0ms
  ․ #LightState set single state transitiontime #transitiontime should set 10: 0ms
  ․ #LightState set single state transitiontime #transitiontime should set 36000: 1ms
  ․ #LightState set single state transitiontime #transitiontime should set 4 if no parameter provided: 0ms
  ․ #LightState set single state transitiontime #transitionTime should set 0: 0ms
  ․ #LightState set single state transitiontime #transitionTime should set 10: 0ms
  ․ #LightState set single state transitiontime #transitionTime should set 65535: 0ms
  ․ #LightState set single state transitiontime #transitionTime should set 4 if no parameter provided: 1ms
  ․ #LightState set single state transitiontime #transitionSlow should set 8: 0ms
  ․ #LightState set single state transitiontime #transitionInstant should set 0: 0ms
  ․ #LightState set single state transitiontime #transitionDefault should set 4: 0ms
  ․ #LightState set single state transitiontime #transitionFast should set 2: 0ms
  ․ #LightState set single state transitiontime #transition should set 100ms: 1ms
  ․ #LightState set single state transitiontime #transition should set 1000ms: 0ms
  ․ #LightState set single state transitiontime #transition should set 20000ms: 1ms
  ․ #LightState set single state #white should set ct=153, bri=50%: 2ms
  ․ #LightState set single state #white should set ct=500, bri=100%: 1ms
  ․ #LightState set single state #white should set ct=0 to ct 153: 2ms
  ․ #LightState set single state #white should set ct=600 to ct 500: 0ms
  ․ #LightState set single state #white should set bri=-10% to bri 0%: 0ms
  ․ #LightState set single state #white should set bri=150% to bri 100%: 0ms
  ․ #LightState set single state #hsb should set (0, 0, 0): 1ms
  ․ #LightState set single state #hsb should set (360, 100, 100): 1ms
  ․ #LightState set single state #hsb should set (180, 50, 25): 2ms
  ․ #LightState set single state #hsl should set (0, 0, 0): 1ms
  ․ #LightState set single state #hsl should set (360, 100, 100): 1ms
  ․ #LightState set single state #hsl should set (180, 50, 25): 1ms
  ․ #LightState set single state #rgb should set (255, 255, 255): 2ms
  ․ #LightState set single state #rgb should set (255, 255, 255): 1ms
  ․ #LightState set single state #rgb should set (-1, 300, -100) to [0, 255, 0]: 1ms
  ․ #LightState set single state #rgb should set via an array [r, g, b]: 0ms
  ․ #LightState set single state bri_inc #bri_inc should set -254: 0ms
  ․ #LightState set single state bri_inc #bri_inc should set 254: 0ms
  ․ #LightState set single state bri_inc #bri_inc should set 0: 0ms
  ․ #LightState set single state bri_inc #bri_inc should set -300 as -254: 0ms
  ․ #LightState set single state bri_inc #bri_inc should set 1.5 as 1: 1ms
  ․ #LightState set single state bri_inc #incrementBrightness should set -254: 0ms
  ․ #LightState set single state bri_inc #incrementBrightness should set 254: 0ms
  ․ #LightState set single state bri_inc #incrementBrightness should set 0: 1ms
  ․ #LightState set single state bri_inc #incrementBrightness should set -300 as -254: 0ms
  ․ #LightState set single state bri_inc #incrementBrightness should set 1.5 as 1: 0ms
  ․ #LightState set single state sat_inc #sat_inc should set -254: 0ms
  ․ #LightState set single state sat_inc #sat_inc should set 254: 0ms
  ․ #LightState set single state sat_inc #sat_inc should set 0: 0ms
  ․ #LightState set single state sat_inc #sat_inc should set -300 as -254: 1ms
  ․ #LightState set single state sat_inc #sat_inc should set 2.4 as 2: 0ms
  ․ #LightState set single state sat_inc #incrementSaturation should set -254: 1ms
  ․ #LightState set single state sat_inc #incrementSaturation should set 254: 1ms
  ․ #LightState set single state sat_inc #incrementSaturation should set 0: 0ms
  ․ #LightState set single state sat_inc #incrementSaturation should set -300 as -254: 0ms
  ․ #LightState set single state sat_inc #incrementSaturation should set 2.4 as 2: 0ms
  ․ #LightState set single state hue_inc #hue_inc should set -65534: 1ms
  ․ #LightState set single state hue_inc #hue_inc should set 65534: 0ms
  ․ #LightState set single state hue_inc #hue_inc should set 0: 0ms
  ․ #LightState set single state hue_inc #hue_inc should set -65570 as -65534: 0ms
  ․ #LightState set single state hue_inc #hue_inc should set 2.4 as 2: 0ms
  ․ #LightState set single state hue_inc #incrementHue should set -65534: 1ms
  ․ #LightState set single state hue_inc #incrementHue should set 65534: 1ms
  ․ #LightState set single state hue_inc #incrementHue should set 0: 0ms
  ․ #LightState set single state hue_inc #incrementHue should set -65570 as -65534: 1ms
  ․ #LightState set single state hue_inc #incrementHue should set 2.4 as 2: 1ms
  ․ #LightState set single state ct_inc #ct_inc should set -65534: 1ms
  ․ #LightState set single state ct_inc #ct_inc should set 65534: 1ms
  ․ #LightState set single state ct_inc #ct_inc should set 0: 0ms
  ․ #LightState set single state ct_inc #ct_inc should set -65570 as -65534: 0ms
  ․ #LightState set single state ct_inc #ct_inc should set -1.2 as -2: 0ms
  ․ #LightState set single state ct_inc #incrementColorTemp should set -65534: 1ms
  ․ #LightState set single state ct_inc #incrementColorTemp should set 65534: 0ms
  ․ #LightState set single state ct_inc #incrementColorTemp should set 0: 0ms
  ․ #LightState set single state ct_inc #incrementColorTemp should set -65570 as -65534: 0ms
  ․ #LightState set single state ct_inc #incrementColorTemp should set -1.2 as -2: 0ms
  ․ #LightState set single state xy_inc #xy_inc should set -0.5: 0ms
  ․ #LightState set single state xy_inc #xy_inc should set 0.5: 0ms
  ․ #LightState set single state xy_inc #xy_inc should set 0: 0ms
  ․ #LightState set single state xy_inc #xy_inc should set -0.6 as -0.5: 0ms
  ․ #LightState set single state xy_inc #incrementXY should set -0.5: 1ms
  ․ #LightState set single state xy_inc #incrementXY should set 0.5: 0ms
  ․ #LightState set single state xy_inc #incrementXY should set 0: 0ms
  ․ #LightState set single state xy_inc #incrementXY should set -0.6 as -0.5: 0ms
  ․ #LightState chaining states should chain on().ct(200): 0ms
  ․ #LightState chaining states should chain on().off().off().on(): 0ms
  ․ #LightState chaining states using #reset set values, reset, then specify more values: 1ms
  ․ #LightState loading from values object should load {on: true, effect: 'colorloop'}: 1ms
  ․ #LightState loading from values object should only load valid values: 1ms
  ․ #LightState loading from values object should convert invalid property values: 0ms
  ․ #LightState loading from values object should load rgb: 0ms
  ․ #LightState #copy should create a copy: 0ms
  ․ #LightState #applyRGB should apply RGB values for Hue Bulb: 2ms
  ․ #LightState #applyRGB should return null if not RGB value set: 1ms
    Hue API #discovery #searchForBridges should find my bridge on the Network: 'searchForBridges' is deprecated, please use 'upnpSearch' instead
  44) Hue API #discovery #searchForBridges should find my bridge on the Network
    Hue API #discovery #locateBridges should find my bridge on the Network using #promise: 'locateBridges' is deprecated, please use 'nupnpSearch' instead
  45) Hue API #discovery #locateBridges should find my bridge on the Network using #promise
    Hue API #discovery #locateBridges should find my bridge on the Network using #callback: 'locateBridges' is deprecated, please use 'nupnpSearch' instead
  46) Hue API #discovery #locateBridges should find my bridge on the Network using #callback
  47) Hue API #newLights #promise should get new lights
  48) Hue API #newLights #callback should get new lights
  49) Hue API #registeredUsers using #promise
  50) Hue API #registeredUsers using #callback
  51) Hue API #registerUser "before each" hook for "using #promise"
  52) Hue API #setLightState to RGB for Hue Bulb should set 255,0,0
  53) Hue API #setLightState to RGB for Hue Bulb should set 255,255,255
  54) Hue API #setLightState to RGB for Hue Bulb should set 0,0,0
  55) Hue API #setLightState to RGB for Living Color should set 255,0,0
  56) Hue API #setLightState to RGB for Living Color should set 255,255,255
  57) Hue API #setLightState to RGB for Living Color should set 0,0,0
  58) Hue API #setLightState to RGB for Living Color shoudl set 128,128,128
  59) Hue API #setLightState to RGB for Lux Bulb should fail when trying to set rgb
  ․ Scene creation should create an object: 0ms
  ․ Scene creation should instantiate from an object: 0ms
  ․ Scene #withName() should set a name of 'node-scene': 0ms
  ․ Scene #withLights should set light IDs from an array: 0ms
  ․ Scene #withLights should set light IDs from an integer: 0ms
  ․ Scene #withLights should set the light IDs from multiple integers: 0ms
  ․ Scene #withTransitionTime should set a transition time value of 5000: 1ms
  ․ Scene #withPicture() should set a picture: 0ms
  ․ Scene #withAppData() should set data: 0ms
  ․ Scene #withRecycle() should set the recycle flag: 0ms
  ․ Scene with chained functions should create a complex scene: 0ms
  60) Hue API get bridge scenes #scenes using #promise
  61) Hue API get bridge scenes #scenes using #callback
  62) Hue API get bridge scenes #getScenes using #promise
  63) Hue API get bridge scenes #getScenes using #callback
  64) Hue API get a scene #scene() using #promise
  65) Hue API get a scene #scene() using #callback
  66) Hue API get a scene #getScene() using #promise
  67) Hue API get a scene #getScene() using #callback
  68) Hue API create scene #createScene() with 1.2.x compatibility with name and lights using #promise
  69) Hue API create scene #createScene() with 1.2.x compatibility with name and lights using #callback
  70) Hue API create scene #createScene() with 1.11.x compatibility with name, lights and transition using #promise
  71) Hue API create scene #createScene() with 1.11.x compatibility with name, lights and transition using #callback
  72) Hue API modifying/updating scenes "before each" hook
  73) Hue API modifying/updating scenes "after each" hook
  74) Hue API modifying scene light states #modifySceneLightState() "before each" hook for "using #promise"
  75) Hue API modifying scene light states #modifySceneLightState() "after each" hook
  76) Hue API activating scenes #activateScene() "before all" hook
  77) Hue API activating scenes #activateScene() "after all" hook
  78) Hue API scheduleTests #getSchedules() should list all scheduled events using #promise
  79) Hue API scheduleTests #getSchedules() should list all scheduled events using #callback
  80) Hue API scheduleTests #scheduleEvent using #promise should schedule a valid event
  81) Hue API scheduleTests #scheduleEvent using #callback should schedule a valid event
  82) Hue API scheduleTests #deleteSchedule "before each" hook
  83) Hue API scheduleTests #updateSchedule "before each" hook for "should update an existing schedule name"
  84) Hue API scheduleTests #updateSchedule "after each" hook
  ․ ScheduleEvent creation should create an object: 0ms
  ․ ScheduleEvent time value should accept valid string time value: 0ms
  85) ScheduleEvent time value should convert valid Date values from strings
  ․ ScheduleEvent time value should not accept invalid date strings: 1ms
  ․ ScheduleEvent time value should accept a valid Date instance: 0ms
  ․ ScheduleEvent time value should accept a recurring time: 0ms
  ․ ScheduleEvent withName() should accept a name: 0ms
  ․ ScheduleEvent withName() should shorten really long names and shorten it: 1ms
  ․ ScheduleEvent withDescription() should accept a description: 0ms
  ․ ScheduleEvent withDescription() should accept a really long description and shorten it: 0ms
  ․ ScheduleEvent withCommand() should take a command string: 1ms
  ․ ScheduleEvent withCommand() should take a command object: 1ms
  ․ ScheduleEvent withEnabledState() should set an enabled state: 0ms
  ․ ScheduleEvent withEnabledState() should set a disabled state: 1ms
  ․ ScheduleEvent create() from object should load name and description values: 0ms
  ․ ScheduleEvent create() from object should load the time: 0ms
  ․ ScheduleEvent create() from object should load a command: 1ms
  ․ ScheduleEvent create() from object should load a status: 0ms
  86) Hue API #searchForLights #promise should get initiate a search
  87) Hue API #searchForLights #callback should initiate a search
  88) Hue API #sensors() should obtain all the sensors in the bridge
  89) Hue API #setLightName #promise should set name
  90) Hue API #setLightName #callback should set name
  91) Hue API #setLightState turn light on using #promise
  92) Hue API #setLightState turn light on using #callback
  93) Hue API #setLightState set alert state using #promise
  94) Hue API #setLightState set alert state using #callback
  95) Hue API #setLightState set brightness increment should increment by 1
  ․ Timer creation should create an object: 0ms
  ․ Timer hour should set 0: 0ms
  ․ Timer hour should set 23: 0ms
  ․ Timer hour should correct -1 to 0: 0ms
  ․ Timer hour should correct 24 to 0: 0ms
  ․ Timer hour should correct 25 to 0: 0ms
  ․ Timer minute should set 0: 0ms
  ․ Timer minute should set 59: 1ms
  ․ Timer minute should set 31: 0ms
  ․ Timer minute should correct -1 to 0: 0ms
  ․ Timer minute should correct 60 to 59: 0ms
  ․ Timer minute should correct 90 to 59: 0ms
  ․ Timer second should set 0: 1ms
  ․ Timer second should set 59: 1ms
  ․ Timer second should set 31: 0ms
  ․ Timer second should correct -1 to 0: 0ms
  ․ Timer second should correct 60 to 59: 1ms
  ․ Timer second should correct 90 to 59: 0ms
  ․ Timer recurring occur once: 0ms
  ․ Timer recurring occur 99 times: 0ms
  ․ Timer recurring occur always: 1ms
  ․ Timer recurring should correct 100 to 99: 1ms
  ․ Timer randomize should randomize 00:00:05: 1ms
  ․ Timer randomize should randomize 01:00:01: 0ms
  ․ Timer randomize should randomize 23:00:00: 0ms

  211 passing (3m)
  2 pending
  95 failing

  1) Hue API #config using #promise:
     Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.

  2) Hue API #config using #callback:
     Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.

  3) Hue API version #version using #promise:
     Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.

  4) Hue API version #version using #callback:
     Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.

  5) Hue API version #getVersion using #promise:
     Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.

  6) Hue API version #getVersion using #callback:
     Uncaught Error: socket hang up
      at createHangUpError (_http_client.js:252:15)
      at Socket.socketCloseListener (_http_client.js:284:23)
      at TCP._handle.close [as _onclose] (net.js:492:12)

  7) Hue API description #description() using #promise:
     Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.

  8) Hue API description #description() using #callback:
     Uncaught Error: socket hang up
      at createHangUpError (_http_client.js:252:15)
      at Socket.socketCloseListener (_http_client.js:284:23)
      at TCP._handle.close [as _onclose] (net.js:492:12)

  9) Hue API description #getDescription() using #promise:
     Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.

  10) Hue API description #getDescription() using #callback:
     Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.

  11) Hue API full state #fullState() using #promise:
     Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.

  12) Hue API full state #fullState() using #callback:
     Uncaught Error: socket hang up
      at createHangUpError (_http_client.js:252:15)
      at Socket.socketCloseListener (_http_client.js:284:23)
      at TCP._handle.close [as _onclose] (net.js:492:12)

  13) Hue API full state #getFullState() using #promise:
     Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.

  14) Hue API full state #getFullState() using #callback:
     Uncaught Error: socket hang up
      at createHangUpError (_http_client.js:252:15)
      at Socket.socketCloseListener (_http_client.js:284:23)
      at TCP._handle.close [as _onclose] (net.js:492:12)

  15) Hue API info #getTimezones() using #promise:
     Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.

  16) Hue API info #getTimezones() using #callback:
     Uncaught Error: socket hang up
      at createHangUpError (_http_client.js:252:15)
      at Socket.socketCloseListener (_http_client.js:284:23)
      at TCP._handle.close [as _onclose] (net.js:492:12)

  17) Hue API info #timezones() using #promise:
     Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.

  18) Hue API info #timezones() using #callback:
     Uncaught Error: socket hang up
      at createHangUpError (_http_client.js:252:15)
      at Socket.socketCloseListener (_http_client.js:284:23)
      at TCP._handle.close [as _onclose] (net.js:492:12)

  19) Hue API #lightStatus #promise should get status of light:
     Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.

  20) Hue API #lightStatus #callback should get status of light:
     Uncaught Error: socket hang up
      at createHangUpError (_http_client.js:252:15)
      at Socket.socketCloseListener (_http_client.js:284:23)
      at TCP._handle.close [as _onclose] (net.js:492:12)

  21) Hue API group tests #groups using #promise should retrieve all groups:
     Uncaught Error: socket hang up
      at createHangUpError (_http_client.js:252:15)
      at Socket.socketCloseListener (_http_client.js:284:23)
      at TCP._handle.close [as _onclose] (net.js:492:12)

  22) Hue API group tests #groups using #callback should retrieve all groups:
     Uncaught Error: socket hang up
      at createHangUpError (_http_client.js:252:15)
      at Socket.socketCloseListener (_http_client.js:284:23)
      at TCP._handle.close [as _onclose] (net.js:492:12)

  23) Hue API group tests #luminaires using #promise:
     Uncaught Error: socket hang up
      at createHangUpError (_http_client.js:252:15)
      at Socket.socketCloseListener (_http_client.js:284:23)
      at TCP._handle.close [as _onclose] (net.js:492:12)

  24) Hue API group tests #luminaires using #callback:
     Error: timeout of 5000ms exceeded. Ensure the done() callback is being called in this test.

  25) Hue API group tests #lightSources using #promise:
     Uncaught Error: socket hang up
      at createHangUpError (_http_client.js:252:15)
      at Socket.socketCloseListener (_http_client.js:284:23)
      at TCP._handle.close [as _onclose] (net.js:492:12)

  26) Hue API group tests #lightSources using #callback:
     Error: timeout of 5000ms exceeded. Ensure the done() callback is being called in this test.

  27) Hue API group tests #lightGroups using #promise:
     Uncaught Error: socket hang up
      at createHangUpError (_http_client.js:252:15)
      at Socket.socketCloseListener (_http_client.js:284:23)
      at TCP._handle.close [as _onclose] (net.js:492:12)

  28) Hue API group tests #lightGroups using #callback:
     Error: timeout of 5000ms exceeded. Ensure the done() callback is being called in this test.

  29) Hue API group tests #getGroup using #promise should obtain 'All Lights' group details:
     Uncaught Error: socket hang up
      at createHangUpError (_http_client.js:252:15)
      at Socket.socketCloseListener (_http_client.js:284:23)
      at TCP._handle.close [as _onclose] (net.js:492:12)

  30) Hue API group tests #getGroup using #promise should fail for a group id that does not exist:
     Error: timeout of 5000ms exceeded. Ensure the done() callback is being called in this test.

  31) Hue API group tests #getGroup using #callback should obtain 'All Lights' group details:
     Uncaught Error: socket hang up
      at createHangUpError (_http_client.js:252:15)
      at Socket.socketCloseListener (_http_client.js:284:23)
      at TCP._handle.close [as _onclose] (net.js:492:12)

  32) Hue API group tests #getGroup using #callback should fail for a group id that does not exist:
     Uncaught AssertionError: expected [Error: socket hang up] to have a property 'type'
      at checkError (test/groups-test.js:159:45)
      at _rejected (node_modules/q/q.js:844:24)
      at node_modules/q/q.js:870:30
      at Promise.when (node_modules/q/q.js:1122:31)
      at Promise.promise.promiseDispatch (node_modules/q/q.js:788:41)
      at node_modules/q/q.js:604:44
      at runSingle (node_modules/q/q.js:137:13)
      at flush (node_modules/q/q.js:125:13)
      at _combinedTickCallback (internal/process/next_tick.js:67:7)
      at process._tickCallback (internal/process/next_tick.js:98:9)

  33) Hue API group tests #createGroup #deleteGroup should create a group and then delete it using #promise:
     Error: timeout of 5000ms exceeded. Ensure the done() callback is being called in this test.

  34) Hue API group tests #createGroup #deleteGroup should create a group and then delete it using #callback:
     Error: timeout of 5000ms exceeded. Ensure the done() callback is being called in this test.

  35) Hue API group tests #updateGroup "before each" hook for "should update only the name of a group":
     Error: timeout of 5000ms exceeded. Ensure the done() callback is being called in this test.

  36) Hue API group tests #updateGroup "after each" hook:
     Uncaught Api Error: The group id 'undefined' cannot be modified on this Hue Bridge.
      at _errorPromise (hue-api/index.js:1410:21)
      at _setGroupIdOptionForModification (hue-api/index.js:1296:24)
      at HueApi.deleteGroup (hue-api/index.js:542:19)
      at Context.<anonymous> (test/groups-test.js:330:21)

  37) Hue API group tests #setGroupLightState using #promise:
     Error: timeout of 5000ms exceeded. Ensure the done() callback is being called in this test.

  38) Hue API group tests #setGroupLightState using #callback:
     Error: timeout of 5000ms exceeded. Ensure the done() callback is being called in this test.

  39) Hue API group tests #_getGroupLightsByType should work for group 0:
     Error: timeout of 5000ms exceeded. Ensure the done() callback is being called in this test.

  40) Hue API #lights() #promise should find some:
     Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.

  41) Hue API #lights() #callback should find some lights:
     Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.

  42) Hue API #getLights() #promise should find some:
     Uncaught Error: socket hang up
      at createHangUpError (_http_client.js:252:15)
      at Socket.socketCloseListener (_http_client.js:284:23)
      at TCP._handle.close [as _onclose] (net.js:492:12)

  43) Hue API #getLights() #callback should find some lights:
     Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.

  44) Hue API #discovery #searchForBridges should find my bridge on the Network:
     Uncaught Error: socket hang up
      at createHangUpError (_http_client.js:252:15)
      at Socket.socketCloseListener (_http_client.js:284:23)
      at TCP._handle.close [as _onclose] (net.js:492:12)

  45) Hue API #discovery #locateBridges should find my bridge on the Network using #promise:

      Uncaught AssertionError: expected '192.168.5.19' to equal '192.168.2.245'
      + expected - actual

      -192.168.5.19
      +192.168.2.245

      at test/locateBridge-tests.js:42:61
      at _fulfilled (node_modules/q/q.js:834:54)
      at self.promiseDispatch.done (node_modules/q/q.js:863:30)
      at Promise.promise.promiseDispatch (node_modules/q/q.js:796:13)
      at node_modules/q/q.js:604:44
      at runSingle (node_modules/q/q.js:137:13)
      at flush (node_modules/q/q.js:125:13)
      at _combinedTickCallback (internal/process/next_tick.js:67:7)
      at process._tickCallback (internal/process/next_tick.js:98:9)

  46) Hue API #discovery #locateBridges should find my bridge on the Network using #callback:
     Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.

  47) Hue API #newLights #promise should get new lights:
     Uncaught Error: socket hang up
      at createHangUpError (_http_client.js:252:15)
      at Socket.socketCloseListener (_http_client.js:284:23)
      at TCP._handle.close [as _onclose] (net.js:492:12)

  48) Hue API #newLights #callback should get new lights:

      Uncaught AssertionError: expected '192.168.5.19' to equal '192.168.2.245'
      + expected - actual

      -192.168.5.19
      +192.168.2.245

      at test/locateBridge-tests.js:42:61
      at _fulfilled (node_modules/q/q.js:834:54)
      at self.promiseDispatch.done (node_modules/q/q.js:863:30)
      at Promise.promise.promiseDispatch (node_modules/q/q.js:796:13)
      at node_modules/q/q.js:604:44
      at runSingle (node_modules/q/q.js:137:13)
      at flush (node_modules/q/q.js:125:13)
      at _combinedTickCallback (internal/process/next_tick.js:67:7)
      at process._tickCallback (internal/process/next_tick.js:98:9)

  49) Hue API #registeredUsers using #promise:
     Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.

  50) Hue API #registeredUsers using #callback:
     Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.

  51) Hue API #registerUser "before each" hook for "using #promise":
     Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.

  52) Hue API #setLightState to RGB for Hue Bulb should set 255,0,0:
     Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.

  53) Hue API #setLightState to RGB for Hue Bulb should set 255,255,255:
     Uncaught Error: socket hang up
      at createHangUpError (_http_client.js:252:15)
      at Socket.socketCloseListener (_http_client.js:284:23)
      at TCP._handle.close [as _onclose] (net.js:492:12)

  54) Hue API #setLightState to RGB for Hue Bulb should set 0,0,0:
     Uncaught Error: socket hang up
      at createHangUpError (_http_client.js:252:15)
      at Socket.socketCloseListener (_http_client.js:284:23)
      at TCP._handle.close [as _onclose] (net.js:492:12)

  55) Hue API #setLightState to RGB for Living Color should set 255,0,0:
     Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.

  56) Hue API #setLightState to RGB for Living Color should set 255,255,255:
     Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.

  57) Hue API #setLightState to RGB for Living Color should set 0,0,0:
     Uncaught Error: socket hang up
      at createHangUpError (_http_client.js:252:15)
      at Socket.socketCloseListener (_http_client.js:284:23)
      at TCP._handle.close [as _onclose] (net.js:492:12)

  58) Hue API #setLightState to RGB for Living Color shoudl set 128,128,128:
     Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.

  59) Hue API #setLightState to RGB for Lux Bulb should fail when trying to set rgb:
     Uncaught Error: socket hang up
      at createHangUpError (_http_client.js:252:15)
      at Socket.socketCloseListener (_http_client.js:284:23)
      at TCP._handle.close [as _onclose] (net.js:492:12)

  60) Hue API get bridge scenes #scenes using #promise:
     Uncaught Error: socket hang up
      at createHangUpError (_http_client.js:252:15)
      at Socket.socketCloseListener (_http_client.js:284:23)
      at TCP._handle.close [as _onclose] (net.js:492:12)

  61) Hue API get bridge scenes #scenes using #callback:
     Uncaught Error: socket hang up
      at createHangUpError (_http_client.js:252:15)
      at Socket.socketCloseListener (_http_client.js:284:23)
      at TCP._handle.close [as _onclose] (net.js:492:12)

  62) Hue API get bridge scenes #getScenes using #promise:
     Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.

  63) Hue API get bridge scenes #getScenes using #callback:
     Uncaught Error: socket hang up
      at createHangUpError (_http_client.js:252:15)
      at Socket.socketCloseListener (_http_client.js:284:23)
      at TCP._handle.close [as _onclose] (net.js:492:12)

  64) Hue API get a scene #scene() using #promise:
     Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.

  65) Hue API get a scene #scene() using #callback:
     Uncaught AssertionError: expected 'socket hang up' to include 'xy, not available'
      at test/rgb-tests.js:120:48
      at _rejected (node_modules/q/q.js:844:24)
      at node_modules/q/q.js:870:30
      at Promise.when (node_modules/q/q.js:1122:31)
      at Promise.promise.promiseDispatch (node_modules/q/q.js:788:41)
      at node_modules/q/q.js:604:44
      at runSingle (node_modules/q/q.js:137:13)
      at flush (node_modules/q/q.js:125:13)
      at _combinedTickCallback (internal/process/next_tick.js:67:7)
      at process._tickCallback (internal/process/next_tick.js:98:9)

  66) Hue API get a scene #getScene() using #promise:
     Uncaught Error: socket hang up
      at createHangUpError (_http_client.js:252:15)
      at Socket.socketCloseListener (_http_client.js:284:23)
      at TCP._handle.close [as _onclose] (net.js:492:12)

  67) Hue API get a scene #getScene() using #callback:
     Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.

  68) Hue API create scene #createScene() with 1.2.x compatibility with name and lights using #promise:
     Uncaught Error: socket hang up
      at createHangUpError (_http_client.js:252:15)
      at Socket.socketCloseListener (_http_client.js:284:23)
      at TCP._handle.close [as _onclose] (net.js:492:12)

  69) Hue API create scene #createScene() with 1.2.x compatibility with name and lights using #callback:
     Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.

  70) Hue API create scene #createScene() with 1.11.x compatibility with name, lights and transition using #promise:
     Uncaught Error: socket hang up
      at createHangUpError (_http_client.js:252:15)
      at Socket.socketCloseListener (_http_client.js:284:23)
      at TCP._handle.close [as _onclose] (net.js:492:12)

  71) Hue API create scene #createScene() with 1.11.x compatibility with name, lights and transition using #callback:
     Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.

  72) Hue API modifying/updating scenes "before each" hook:
     Uncaught Error: socket hang up
      at createHangUpError (_http_client.js:252:15)
      at Socket.socketCloseListener (_http_client.js:284:23)
      at TCP._handle.close [as _onclose] (net.js:492:12)

  73) Hue API modifying/updating scenes "after each" hook:
     Uncaught Api Error: The scene id 'undefined' is not valid for this Hue Bridge.
      at _errorPromise (hue-api/index.js:1410:21)
      at _setSceneIdOption (hue-api/index.js:1393:24)
      at HueApi.deleteScene (hue-api/index.js:711:19)
      at Context.<anonymous> (test/scene-tests.js:246:13)

  74) Hue API modifying scene light states #modifySceneLightState() "before each" hook for "using #promise":
     Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.

  75) Hue API modifying scene light states #modifySceneLightState() "after each" hook:
     Uncaught Api Error: The scene id 'undefined' is not valid for this Hue Bridge.
      at _errorPromise (hue-api/index.js:1410:21)
      at _setSceneIdOption (hue-api/index.js:1393:24)
      at HueApi.deleteScene (hue-api/index.js:711:19)
      at Context.<anonymous> (test/scene-tests.js:382:13)

  76) Hue API activating scenes #activateScene() "before all" hook:
     Uncaught Error: socket hang up
      at createHangUpError (_http_client.js:252:15)
      at Socket.socketCloseListener (_http_client.js:284:23)
      at TCP._handle.close [as _onclose] (net.js:492:12)

  77) Hue API activating scenes #activateScene() "after all" hook:
     Uncaught Api Error: The scene id 'undefined' is not valid for this Hue Bridge.
      at _errorPromise (hue-api/index.js:1410:21)
      at _setSceneIdOption (hue-api/index.js:1393:24)
      at HueApi.deleteScene (hue-api/index.js:711:19)
      at Context.<anonymous> (test/scene-tests.js:447:13)

  78) Hue API scheduleTests #getSchedules() should list all scheduled events using #promise:
     Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.

  79) Hue API scheduleTests #getSchedules() should list all scheduled events using #callback:
     Uncaught Error: socket hang up
      at createHangUpError (_http_client.js:252:15)
      at Socket.socketCloseListener (_http_client.js:284:23)
      at TCP._handle.close [as _onclose] (net.js:492:12)

  80) Hue API scheduleTests #scheduleEvent using #promise should schedule a valid event:
     Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.

  81) Hue API scheduleTests #scheduleEvent using #callback should schedule a valid event:
     Uncaught Error: socket hang up
      at createHangUpError (_http_client.js:252:15)
      at Socket.socketCloseListener (_http_client.js:284:23)
      at TCP._handle.close [as _onclose] (net.js:492:12)

  82) Hue API scheduleTests #deleteSchedule "before each" hook:
     Uncaught Error: socket hang up
      at createHangUpError (_http_client.js:252:15)
      at Socket.socketCloseListener (_http_client.js:284:23)
      at TCP._handle.close [as _onclose] (net.js:492:12)

  83) Hue API scheduleTests #updateSchedule "before each" hook for "should update an existing schedule name":
     Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.

  84) Hue API scheduleTests #updateSchedule "after each" hook:
     Uncaught Api Error: The schedule id 'undefined' is not valid for this Hue Bridge.
      at _errorPromise (hue-api/index.js:1410:21)
      at _setScheduleIdOption (hue-api/index.js:1316:24)
      at HueApi.deleteSchedule (hue-api/index.js:615:19)
      at Context.<anonymous> (test/schedule-tests.js:190:21)

  85) ScheduleEvent time value should convert valid Date values from strings:

      AssertionError: expected '1975-10-13T15:13:00' to equal '1975-10-13T10:13:00'
      + expected - actual

      -1975-10-13T15:13:00
      +1975-10-13T10:13:00

      at Context.<anonymous> (test/scheduledEvent-tests.js:46:69)

  86) Hue API #searchForLights #promise should get initiate a search:
     Uncaught Error: socket hang up
      at createHangUpError (_http_client.js:252:15)
      at Socket.socketCloseListener (_http_client.js:284:23)
      at TCP._handle.close [as _onclose] (net.js:492:12)

  87) Hue API #searchForLights #callback should initiate a search:
     Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.

  88) Hue API #sensors() should obtain all the sensors in the bridge:
     Uncaught Error: socket hang up
      at createHangUpError (_http_client.js:252:15)
      at Socket.socketCloseListener (_http_client.js:284:23)
      at TCP._handle.close [as _onclose] (net.js:492:12)

  89) Hue API #setLightName #promise should set name:
     Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.

  90) Hue API #setLightName #callback should set name:
     Uncaught Error: socket hang up
      at createHangUpError (_http_client.js:252:15)
      at Socket.socketCloseListener (_http_client.js:284:23)
      at TCP._handle.close [as _onclose] (net.js:492:12)

  91) Hue API #setLightState turn light on using #promise:
     Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.

  92) Hue API #setLightState turn light on using #callback:
     Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.

  93) Hue API #setLightState set alert state using #promise:
     Uncaught Error: socket hang up
      at createHangUpError (_http_client.js:252:15)
      at Socket.socketCloseListener (_http_client.js:284:23)
      at TCP._handle.close [as _onclose] (net.js:492:12)

  94) Hue API #setLightState set alert state using #callback:
     Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.

  95) Hue API #setLightState set brightness increment should increment by 1:
     Error: socket hang up
      at createHangUpError (_http_client.js:252:15)
      at Socket.socketCloseListener (_http_client.js:284:23)
      at TCP._handle.close [as _onclose] (net.js:492:12)

npm ERR! Test failed.  See above for more details.
peter-murray commented 7 years ago

The tests are specify to my own bridge, I use them to check for any regressions, they are not for others to run, as they are not portable (they rely on things in my bridge for validation).

I am considering capturing the results using nock (which I do for another node.js project) but have not had the time to port the test framework over.

There are two methods for finding a bridge, one via an older nupnp and the other upnp search.

nupnp search is the preferred method, as that will use the meethue portal to discover your bridge, whereas the upnp search that uses UDP to try and find the bridge on the network, which can be problematic but was the preferred way before Phillips added the meethue option via the API.

mattfelsen commented 7 years ago

Hi Peter, thanks for getting back so quickly! Ok, that makes sense about the tests not working. I'm still having trouble with the nupnp search – but not at the API level. I tried both the promise & callback styles from the bridge-finding example:

var hue = require("node-hue-api");

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

// --------------------------
// Using a promise
hue.nupnpSearch().then(displayBridges).done();

// --------------------------
// Using a callback
hue.nupnpSearch(function(err, result) {
    if (err) throw err;
    displayBridges(result);
});

And for either case I'm getting the same parsing error. Maybe something changed in a new firmware version? The listed software version showin the Hue app is 01036659. Here's the error output:

$ node hue.json 
module.js:561
    throw err;
    ^

SyntaxError: /Users/matt/Documents/Code/Projects/magicians/magicians-scripts/hue/hue.json: Unexpected token v in JSON at position 0
    at Object.parse (native)
    at Object.Module._extensions..json (module.js:558:27)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Module.runMain (module.js:575:10)
    at run (bootstrap_node.js:352:7)
    at startup (bootstrap_node.js:144:9)
    at bootstrap_node.js:467:3
peter-murray commented 7 years ago

I just released version 2.4.0 of the library, can you try that (I don't think it will change anything, but will put you on the same as me for testing).

Also can you provide me with the output of the config() function on your bridge (with things like your mac and ip address taken out) and I can look further into it.

mattfelsen commented 7 years ago

Oy, I just realized an embarrassing mistake. I named my file hue.json instead of hue.js, so node was trying to parse it as json. I'm able to get this result now after renaming the file to hue.js:

Hue Bridges Found: [{"id":"xxx","ipaddress":"yyy"},{"id":"zzz","ipaddress":"www"}]

Sorry for the hassle!