Skip to content

Instantly share code, notes, and snippets.

@andrewk
Last active January 3, 2016 20:58
Show Gist options
  • Save andrewk/8518082 to your computer and use it in GitHub Desktop.
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.
// 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();
});
@andrewk
Copy link
Author

andrewk commented Jan 21, 2014

Yup, that's correct. Corrected, thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment