Last active
October 3, 2015 01:08
-
-
Save micha149/2360108 to your computer and use it in GitHub Desktop.
Usage prototype for home-js a nodeJS based toolkit for KNX home automation
This file contains 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
var latitude = 50.78, | |
longtitude = 7.15, | |
timer = new BlendsTimer(address, connection); | |
up = new RandomTimeOffset({ | |
time: new DayTimeSunrise(latitude, longtitude), | |
min: "+30m", | |
max: "+1h" | |
}); | |
down = new RandomTimeOffset({ | |
time: new DayTime("18:00:00"), | |
min: "-30m", | |
max: "+45m" | |
}); | |
timer.setUpTime(up); | |
timer.setDownTime(down); |
This file contains 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
var connection, address, | |
homelib = require("homelib"), | |
UsbDriver = homelib.Driver.UsbDriver | |
Connection = homelib.Connection, | |
GroupAddress = homelib.GroupAddress; | |
connection = new Connection(new UsbDriver('usb:1:5:1:0')); | |
address = new GroupAddress({ | |
address: "1/2/13" | |
type: "1.001" | |
title: "Livingroom – Light on ceiling" | |
}); | |
connection.send(address, true); | |
connection.on(address, function(message) { | |
console.log(message.getData()); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment