Last active
January 3, 2016 20:58
-
-
Save andrewk/8518082 to your computer and use it in GitHub Desktop.
Current state of the API for the scheduling and compensation client of a distributed, open source home automation platform I'm developing. Requesting early feedback as this is the code users will most often interact with and one of the areas in greatest need of flexibility.
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
// scheduling supports all formats offered by later.js (http://bunkat.github.io/later/) | |
// Scheduled device event | |
schedule('blinds', 'open').at('10:00am').execute(); | |
schedule('blinds', 'closed').at('5:00pm').execute(); | |
// Scheduled compensation triggers | |
every('5 minutes') | |
.if(env.tooHot | |
.respond(turnOnFans) | |
.execute(); | |
// Environment event triggering timed device event | |
env.on('tooHot', function() { | |
switchDevice('aircon', 'on') | |
.for('30 minutes') | |
.execute(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yup, that's correct. Corrected, thanks :)