Skip to content

Commit

Permalink
🚧 Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
epilande committed Dec 21, 2016
1 parent 13399a2 commit 68713a6
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lux.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ const screenBrightness = require('screen-brightness');
const brightness = require('brightness');

let brightnessLevel;
// TODO: Allow this to be configurable
const min = 0.3;
const max = 1;

const setCurrentBrightness = () => {
brightness.get()
Expand All @@ -10,9 +13,6 @@ const setCurrentBrightness = () => {
});
}

const min = 0.3;
const max = 0.8;

const normalizeBrightness = () => {
const averageBrightness = screenBrightness() / 255;
let diff = brightnessLevel - averageBrightness;
Expand All @@ -24,9 +24,7 @@ const normalizeBrightness = () => {
brightness.set(diff);
}

setCurrentBrightness();
setInterval(normalizeBrightness, 500);

module.exports = {
setCurrentBrightness,
normalizeBrightness,
};

0 comments on commit 68713a6

Please sign in to comment.