dubocr / homebridge-gpio-device

Homebridge GPIO device expose several HomeKit accessories interacting with GPIO
Apache License 2.0
66 stars 20 forks source link

Fixed dependency, fixed issues with async/await & HomeBridge API #102

Closed petaren closed 3 years ago

petaren commented 3 years ago

I'm not a node developer, forgive me if I'm doing something wrong.

When trying to install your plugin myself I faced an error message that "wiringpi" couldn't be installed. I investigated the project to figure out how difficult it would be to swap out the dependency on wiringpi for something like onoff. Turns out you've already done most of the work. I only had to swap out the dependency on wiringpi in the package.json file.

When running the plugin, I got a runtime error for the registerAccessory method, which seemed to have one too many parameters according to the HomeBridge documentation. So I removed one.

Lastly when I tried running it again I got some errors stating that await cannot be used in functions that are not marked as async. So I added async on some of the function definitions. This ended up working.

camrun91 commented 3 years ago

@dubocr I can confirm that this appears to fix the issues a lot of people are having with this plug in. this branch works with node 14.x

camrun91 commented 3 years ago

OK may have spoke too soon trying to look into this now.

camrun91 commented 3 years ago

@petaren @dubocr This is working with most current versions of node and homebridge. I was using the wrong pin numbers earlier.