bmontgomery / wemo-rest-api Goto Github PK
View Code? Open in Web Editor NEWWraps a simple web API around a Wemo Switch
Wraps a simple web API around a Wemo Switch
This API is beautiful and works well but one thing I've noticed is that a lot of the time when I use the 'toggle' command, it doesn't toggle properly.
From my observations, it seems to be about every third toggle, although this varies.
I've tried giving it a little more time between each toggle but it doesn't seem to help much.
Screencap; terminal (left), my GUI (right) -- I'll even flick you a copy of it for your troubles, if you'd like.
As you can see from the SetBinaryState actions, the toggle is inconsistent.
Any ideas?
Hi,
I'm just not sure what values are supposed to go here (within config.js):
config.certificate = 'certificate.crt';
config.privateKey = 'privateKey.key';
Where do I find them?
Thanks
*Edit: Discovered I just need to create my own key and crt (used openssl)
Hi again,
I noticed the code doesn't recognize the "Insight" switches. I added some code allow recognition:
WemoControllee.deviceType = ["urn:Belkin:device:controllee:1","urn:Belkin:device:insight:1"] ;
Then of course in handleDevice I added:
if (indexOf.call( wemo.WemoControllee.deviceType, device.deviceType ) >=0 )
as the check. I defined indexOf using some stack overflow comment: http://stackoverflow.com/questions/1181575/javascript-determine-whether-an-array-contains-a-value
Anyway, to get to my question.... I don't see a way to tell the program which device I want to turn on or off using the friendly name. I'm new to node.js, so if I'm missing that option as I parse the code, please let me know.
thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.