Created
January 21, 2016 15:56
-
-
Save dblencowe/40edcd2d3ddd0a74fdeb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // The following is pseudo code | |
| response = ['lounge', 'main', 'on']; | |
| device = ""; | |
| response.each(function (word){ | |
| device += word; // pop it here so the word is actually removed | |
| response.splice(response.indexOf(word)); | |
| rst = database.select("SELECT FROM devices WHERE name = " + command); | |
| if (rst.length == 1) { | |
| jsonCommand = interpretCommand(response); | |
| server.call(device, jsonCommand); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment