Skip to content

Commit

Permalink
(simatec) Bugfix Brightness down
Browse files Browse the repository at this point in the history
  • Loading branch information
simatec committed Nov 11, 2024
1 parent 409d1fb commit 1acdb5a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ When the adapter crashes or an other Code error happens, this error message that

## Changelog
<!-- ### __WORK IN PROGRESS__ -->
### __WORK IN PROGRESS__
* (simatec) Bugfix Brightness down

### 1.8.4 (2024-11-07)
* (simatec) Issue Info added
* (simatec) Dependencies updated
Expand Down
2 changes: 1 addition & 1 deletion lib/shutterBrightnessSensor.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ async function shutterBrightnessSensor(adapter, brightnessValue, shutterSettings
const driveDelayAstro = adapter.config.driveDelayUpAstro != 0 ? adapter.config.driveDelayUpAstro * 1000 : 20;
const currentTime = getDate();

if (currentTime > shutterDownBrightnessTime &&
if (currentTime >= shutterDownBrightnessTime &&
brightnessValue <= shutterDownBrightness &&
brightnessDown == false) {

Expand Down
8 changes: 7 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,15 @@ function startAdapter(options) {
schedule.cancelJob('shutterDownBrightness');

const downBrightness = schedule.scheduleJob('shutterDownBrightness', downTime[1] + ' ' + downTime[0] + ' * * *', async function () {
adapter.log.debug(`Brightness State Down is: ${brightnessDown}`);
adapter.log.debug(`Brightness sensor value: ${state.val}`);
shutterBrightnessSensor(adapter, state.val, shutterSettings, brightnessDown);

await sleep(10000);
brightnessDown = brightnessState(adapter, state.val, brightnessDown);
adapter.log.debug(`Brightness State Down is: ${brightnessDown}`);
});
// @ts-ignore
// @ts-ignore
} else if (state.val > 0) {
schedule.cancelJob('shutterDownBrightness');
}
Expand Down

0 comments on commit 1acdb5a

Please sign in to comment.