Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ToggleMode.Turnon is not a function #5

Open
hungvuongvn opened this issue Nov 19, 2018 · 3 comments
Open

ToggleMode.Turnon is not a function #5

hungvuongvn opened this issue Nov 19, 2018 · 3 comments

Comments

@hungvuongvn
Copy link

I am getting error when excute ./toggle.switchmate deviceid - ToggleMode.Turnon is not a function. Any helps? Thank you.

@valkjsaaa
Copy link
Owner

Can you paste the full command line output here?

@hungvuongvn
Copy link
Author

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)

Thanks in advance.

@hungvuongvn
Copy link
Author

and this is for switchmate 3:

pi@raspberrypi:/usr/lib/node_modules/node-switchmate3/bin $ sudo ./discover.switchmate3
Discovering Switchmates3.
Discovery will finish in 30 seconds.
Switchmate3 found.
{ "id" : "f3dd0313427f" }
^Cpi@raspberrypi:/usr/lib/node_modules/node-switchmate3/bin $ sudo ./toggle.switchmate3 f3dd0313427f on
Locating f3dd0313427f.
found
/usr/lib/node_modules/node-switchmate3/bin/toggle.switchmate3:58
(targetState === 'on') ? ToggleMode.TurnOn() : ToggleMode.TurnOff();
^

TypeError: ToggleMode.TurnOn is not a function
at onFound (/usr/lib/node_modules/node-switchmate3/bin/toggle.switchmate3:58:45)
at EventEmitter.onDiscoverWithFilter (/usr/lib/node_modules/node-switchmate3/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/lib/node_modules/node-switchmate3/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/lib/node_modules/node-switchmate3/node_modules/noble-device/node_modules/noble/lib/noble.js:178:10)
at emitMany (events.js:108:13)
at emit (events.js:182:7)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants