nschum / homebridge-twinkly

37 stars 10 forks source link

Function "getBrightness" failing #8

Closed dfuchslin closed 3 years ago

dfuchslin commented 3 years ago

Thanks for this great homebridge plugin!

Following the standard configuration, I got it up and running, connected to my 2 Twinkly sets. However, in Home.app the Twinklys report as "no response". I can turn them on and off, and set brightness from Home.app as well as from Homebridge. However, the brightness status is not reported.

I did some debugging and found that the getBrightness function in Twinkly.js references an incorrect function from RequestQueue: "TypeError: this.requestService.getJson is not a function".

I forked this repo, made the appropriate change, installed in Homebridge. Works great now! The current brightness values show up in Homebridge and Home.app, as well as the Twinklys are no longer reporting as "no response" in Home.app.

GunnarBaldursson commented 3 years ago

Still says no response in homekit here

WendelFelius commented 3 years ago

Nice work. How do I install your fork?

Edit: Usednpm install -g git+https://github.com/dfuchslin/homebridge-twinkly.git, seems to work now! Thanks!

dfuchslin commented 3 years ago

Hopefully the author will review this PR, merge, then you can install the official version rather than my forked version. However, to install the fork, open a shell to the location of the homebridge package.json containing your installed plugins:

Remove the official version: npm remove homebridge-twinkly

Add the forked-version: npm install dfuchslin/homebridge-twinkly

Restart homebridge as required.

nschum commented 3 years ago

@dfuchslin Thanks! I guess I'm really not compatible with dynamic languages. :)

I'll release a new version with this fix soon.

dfuchslin commented 3 years ago

Thank you again for this great plugin!