{"_id":"55a681e5aaf9cf19001150d9","__v":3,"project":"55a47338e75ca60d00a3932f","category":{"_id":"55a6703b80c8a30d00b32685","version":"55a47338e75ca60d00a39332","project":"55a47338e75ca60d00a3932f","__v":6,"pages":["55a670a5aaf9cf1900115069","55a67fefaaf9cf19001150ce","55a6804aaaf9cf19001150d1","55a6818480c8a30d00b326d7","55a681e5aaf9cf19001150d9","55a682ae51457325000e4de0"],"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-07-15T14:37:47.055Z","from_sync":false,"order":2,"slug":"javascript-api","title":"Javascript API"},"version":{"_id":"55a47338e75ca60d00a39332","project":"55a47338e75ca60d00a3932f","__v":8,"createdAt":"2015-07-14T02:26:00.724Z","releaseDate":"2015-07-14T02:26:00.724Z","categories":["55a47339e75ca60d00a39333","55a4fb7e1a5f991700a940f0","55a6702b80c8a30d00b32684","55a6703b80c8a30d00b32685","55a6ea5516d20b1900ed8f53","55b23ad2329f363900fbc92f","55b23b0a329f363900fbc932","55b2426a0e11590d008f7950"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"user":"55a4f13d02b09d1900d00a9f","updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-07-15T15:53:09.522Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":4,"body":"This function returns a bunch of methods for controlling a device.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"lc = new LonoClient //...\\ndevice = lc.get_device(\\\"device id\\\")\\n\\n// now, you can do something like this:\\n// device.set_zone(0, true, function(err, body) {\\n//   console.log(\\\"Turned on zone one!\\\", err, body);\\n// });\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"lonoclientget_devicedevice_id","type":"fn","title":"LonoClient.get_device(device_id)"}

LonoClient.get_device(device_id)


This function returns a bunch of methods for controlling a device. [block:code] { "codes": [ { "code": "lc = new LonoClient //...\ndevice = lc.get_device(\"device id\")\n\n// now, you can do something like this:\n// device.set_zone(0, true, function(err, body) {\n// console.log(\"Turned on zone one!\", err, body);\n// });", "language": "javascript" } ] } [/block]