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
# -*- coding: utf-8 -*- | |
# | |
# numbers.py | |
# | |
# David Janes | |
# 2016-10-21 | |
# | |
# Program to solve (more generally): | |
# | |
# Take the digits 5, 4, 3, 2 and 1, in that order. |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"iot:Connect" | |
], | |
"Resource": [ | |
"*" |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"iot:Connect" | |
], | |
"Resource": [ | |
"*" |
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
/* | |
make sure to | |
homestar install iotdb-transport-mqtt | |
homestar install iotdb-transport-iotdb | |
(npm install will probably work too) | |
Further reading on transporter | |
https://homestar.io/about/transporters |
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
things = require('iotdb').connect() | |
things | |
.with_facet(":media.tv") | |
.with_zone("Living Room") | |
.set(":on", true) | |
.set(":band", ":band.service.netflix") | |
things | |
.with_facet(":lighting") |
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
-- CREATE VIEW not implemented yet | |
CREATE VIEW | |
LivingRoom | |
WHERE | |
meta:zone & "Living Room"; | |
CREATE ACTION | |
NetflixChill | |
BEGIN | |
UPDATE |
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
-- this assumes that the TV supports Netflix (my LG does) | |
CREATE SCENE | |
NetflixChill | |
BEGIN | |
SET | |
state:on = true, | |
state:band = iot-attribute:band.service.netflix | |
WHERE | |
meta:facet & iot-facet:media.tv; | |
AND |
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
CREATE THING JohnnyFiveButton WITH pin = 4, meta:name = "The Button"; | |
CREATE THING JohnnyFiveLED WITH pin = 6, meta:name = "The LED"; | |
CREATE RULE | |
LED | |
WHERE | |
meta:name = "The Button" | |
BEGIN | |
SET | |
state:on = $_$state:on |
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
/* | |
* repeat-3.js | |
* | |
* David Janes | |
* IOTDB.org | |
* 2014-12-30 | |
* | |
* This will broadcast Count=0, Count=1, Count=3 | |
* when pushed. | |
*/ |
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
{ | |
"@context": { | |
"@base": "file:///hue-light", | |
"@vocab": "file:///hue-light#", | |
"iot": "https://iotdb.org/pub/iot#", | |
"schema": "http://schema.org/", | |
"iot-attribute": "https://iotdb.org/pub/iot-attribute#" | |
}, | |
"@id": "", | |
"@type": "iot:Model", |