emmcc / node-switchmate

A Node.js API for automating the Switchmate light switch cover.
MIT License
7 stars 4 forks source link

TypeError: PairMode.PairSwitchmate is not a function #16

Open vmarks opened 6 years ago

vmarks commented 6 years ago

I had homebridge and switchmate working, but ended up needing to reinstall. on a clean install, I am able to discover switchmates, but cannot pair.

` $ ./pair.switchmate f31a3e2195ec Locating f31a3e2195ec. /usr/local/lib/node_modules/homebridge-switchmate/node_modules/node-switchmate/bin/pair.switchmate:50 PairMode.PairSwitchmate(); ^

TypeError: PairMode.PairSwitchmate is not a function at onFound (/usr/local/lib/node_modules/homebridge-switchmate/node_modules/node-switchmate/bin/pair.switchmate:50:14) at EventEmitter.onDiscoverWithFilter (/usr/local/lib/node_modules/homebridge-switchmate/node_modules/node-switchmate/node_modules/noble-device/lib/util.js:97:11) at emitOne (events.js:77:13) at EventEmitter.emit (events.js:169:7) at Noble.constructor.onDiscover (/usr/local/lib/node_modules/homebridge-switchmate/node_modules/node-switchmate/node_modules/noble-device/lib/util.js:30:29) at emitOne (events.js:77:13) at Noble.emit (events.js:169:7) at Noble.onDiscover (/usr/local/lib/node_modules/homebridge-switchmate/node_modules/node-switchmate/node_modules/noble-device/node_modules/noble/lib/noble.js:178:10) at emitMany (events.js:108:13) at emit (events.js:182:7) `

JimJamUrCode commented 6 years ago

I have this same error occuring, here is my console output:

sudo ./pair.switchmate dec878114aef Locating xxxxxxxxxxxx. /home/me/node-switchmate/bin/pair.switchmate:50 PairMode.PairSwitchmate(); ^

TypeError: PairMode.PairSwitchmate is not a function at onFound (/home/me/node-switchmate/bin/pair.switchmate:50:14) at EventEmitter.onDiscoverWithFilter (/home/me/node-switchmate/node_modules/noble-device/lib/util.js:97:11) at emitOne (events.js:77:13) at EventEmitter.emit (events.js:169:7) at Noble.constructor.onDiscover (/home/me/node-switchmate/node_modules/noble-device/lib/util.js:30:29) at emitOne (events.js:77:13) at Noble.emit (events.js:169:7) at Noble.onDiscover (/home/me/node-switchmate/node_modules/noble-device/node_modules/noble/lib/noble.js:178:10) at emitMany (events.js:108:13) at emit (events.js:182:7)

hungvuongvn commented 5 years ago

Same her as well.

pi@raspberrypi:/usr/local/lib/node_modules/node-switchmate/bin $ sudo ./toggle.s witchmate f3dd0313427f on Locating f3dd0313427f. Found Switchmate v1/2 /usr/local/lib/node_modules/node-switchmate/bin/toggle.switchmate:61 (targetState === 'on') ? ToggleMode.TurnOn() : ToggleMode.TurnOff(); ^

TypeError: ToggleMode.TurnOn is not a function at onFound (/usr/local/lib/node_modules/node-switchmate/bin/toggle.switchmat e:61:45) at EventEmitter.onDiscoverWithFilter (/usr/local/lib/node_modules/node-switc hmate/node_modules/noble-device/lib/util.js:97:11) at emitOne (events.js:77:13) at EventEmitter.emit (events.js:169:7) at Noble.constructor.onDiscover (/usr/local/lib/node_modules/node-switchmate /node_modules/noble-device/lib/util.js:30:29) at emitOne (events.js:77:13) at Noble.emit (events.js:169:7) at Noble.onDiscover (/usr/local/lib/node_modules/node-switchmate/node_module s/noble-device/node_modules/noble/lib/noble.js:178:10) at emitMany (events.js:108:13) at emit (events.js:182:7)