Skip to content

Commit

Permalink
Changed darkStart from sunsetStart minus 30 minutes to goldenHour (wh…
Browse files Browse the repository at this point in the history
…ich is about 40 minutes before sunsetStart).
  • Loading branch information
chriswaalberg committed Apr 21, 2014
1 parent 2a6a7ee commit 30f3aba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var lights = [1, 2, 3, 4]; //TODO Get the lights from the hue API? Not very useful though, since the lights are hard code into the config.rules as well.
var lights = [1, 2, 3, 4]; //Or should we get the lights from the hue API? Not very useful though, since the lights are hard code into the states as well.
var states = {
"bright": {
"1": { "on": true, "bri": 254, "ct": 403 },
Expand Down
3 changes: 2 additions & 1 deletion hue.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ function scheduleSunBasedJobs() {
// lightStart is the first moment when it's completely light,
// darkStart is the first moment when it starts getting dark.
// This seems to be the most logical for now with the currently thought of rules.
// I guess it's a personal preference, so perhaps this should be a setting.
var _sunTimes = SunCalc.getTimes(new Date(), settings.lat, settings.long);
SUNTIMES.lightStart = new Date(_sunTimes.sunriseEnd);
SUNTIMES.darkStart = new Date(new Date(_sunTimes.sunsetStart).getTime() - 30 * 60000); // Subtract 30 minutes, to really get the moment when it starts getting dark.
SUNTIMES.darkStart = new Date(_sunTimes.goldenHour);

// Cancel yesterday's sun based schedules.
for (var i = 0; i < SUNBASEDSCHEDULES.length; i++) {
Expand Down

0 comments on commit 30f3aba

Please sign in to comment.