Skip to content

Commit

Permalink
(simatec) small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
simatec committed Aug 9, 2024
1 parent d0a3615 commit 8c2cd9e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/sunProtect.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ async function sunProtect(adapter, elevation, azimuth, shutterSettings) {
shutterSettings[s].tempSensor != '') ||
(shutterSettings[s].triggerID == '' &&
shutterSettings[s].tempSensor != '')) {

let insideTemp = 0;
let outsideTemp = 0;
let sunLight = 0;
Expand Down Expand Up @@ -453,17 +453,17 @@ async function sunProtect(adapter, elevation, azimuth, shutterSettings) {
resultDirectionRangePlus > azimuth &&
insideTemp > shutterSettings[s].tempInside) {

if (shutterSettings[s].tempOutside < outsideTemp &&
if (shutterSettings[s].tempOutside < outsideTemp &&
(shutterSettings[s].lightSensor != '' &&
shutterSettings[s].valueLight < sunLight ||
shutterSettings[s].lightSensor == '') &&
shutterSettings[s].currentAction != 'sunProtect' &&
shutterSettings[s].currentAction != 'OpenInSunProtect' &&
shutterSettings[s].currentAction != 'Manu_Mode') {

if (pendingAlarm == false) {
if (pendingAlarm == false) {

const _shutterState = await adapter.getForeignStateAsync(shutterSettings[s].name).catch((e) => adapter.log.warn(e));
const _shutterState = await adapter.getForeignStateAsync(shutterSettings[s].name).catch((e) => adapter.log.warn(e));

if (_shutterState?.val !== null && _shutterState?.val !== undefined) {

Expand Down Expand Up @@ -684,7 +684,7 @@ async function sunProtect(adapter, elevation, azimuth, shutterSettings) {

if (pendingAlarm == false) {
const _shutterState = await adapter.getForeignStateAsync(shutterSettings[s].name).catch((e) => adapter.log.warn(e));
adapter.log.warn(JSON.stringify(shutterSettings[s]));

if (_shutterState?.val !== null && _shutterState?.val !== undefined) {
if (shutterSettings[s].triggerAction == 'sunProtect' &&
shutterSettings[s].KeepSunProtect === false &&
Expand Down

0 comments on commit 8c2cd9e

Please sign in to comment.