yujinakayama / homebridge-switchbot

Homebridge plugin for SwitchBot
29 stars 4 forks source link

Replace gatttool with native implementation #6

Closed dnicolson closed 4 years ago

dnicolson commented 4 years ago

This pull request removes the switchbot dependency (which requires gatttool) and replaces it with a noble-based solution with the equivalent functionality and more.

In addition to being able to use the turn on and off commands, there is state awareness. If a command is issued when the device is already in that state, the promise will be resolved and no action will be taken other than the status changing in the Home app.

The module pattern has been used to encapsulate the peripheral reference, this way the original Homebridge code needs almost no modification.

Also, it appears that npm doesn't properly display the metadata of this repo? https://www.npmjs.com/package/homebridge-switchbot