Skip to content

Commit

Permalink
(simatec) small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
simatec committed Jul 29, 2024
1 parent d5ec573 commit afff2cf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,21 +204,21 @@ function startAdapter(options) {
});
resSunInsideTemp.forEach(async function (resSunInsideTempID) {
if (id === resSunInsideTempID && state.ts === state.lc) {
adapter.log.debug(`insidetemperature changed: ${resSunInsideTempID} | Value: ${state.val}`);
adapter.log.debug(`insidetemperature changed: ${resSunInsideTempID} | Value: ${state.val}°C`);
sunProtect(adapter, elevation, azimuth, shutterSettings);
}
});
resSunOutsideTemp.forEach(async function (resSunOutsideTempID) {
if (id === resSunOutsideTempID && state.ts === state.lc && state.val !== null) {
adapter.log.debug(`outsidetemperature changed: ${resSunOutsideTempID} | Value: ${state.val}`);
adapter.log.debug(`outsidetemperature changed: ${resSunOutsideTempID} | Value: ${state.val}°C`);
sunProtect(adapter, elevation, azimuth, shutterSettings);
}
});
resSunLight.forEach(async function (resSunLightID) {
if (id === resSunLightID && state.ts === state.lc) {
// @ts-ignore
if (Math.round((new Date(state.lc) - new Date(lastLigthSensorValue[`${resSunLightID}`].ts)) / 1000 / 60) > 2) {
adapter.log.debug(`Lightsensor changed: ${resSunLightID} | Value: ${state.val}`);
adapter.log.debug(`Lightsensor changed: ${resSunLightID} | Value: ${state.val}lux`);
sunProtect(adapter, elevation, azimuth, shutterSettings);
lastLigthSensorValue[`${resSunLightID}`].ts = state.lc;
}
Expand Down

0 comments on commit afff2cf

Please sign in to comment.