Skip to content

Commit

Permalink
(simatec) Fix Alarm
Browse files Browse the repository at this point in the history
  • Loading branch information
simatec committed Oct 16, 2024
1 parent dce406c commit 82f58ef
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 144 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ When the adapter crashes or an other Code error happens, this error message that

## Changelog
<!-- ### __WORK IN PROGRESS__ -->
### __WORK IN PROGRESS__
* (simatec) Fix Alarm
* (simatec) Fix Design
* (simatec) Dependencies updated

### 1.8.2 (2024-09-23)
* (simatec) Responsive design Fix

Expand Down
8 changes: 4 additions & 4 deletions lib/shutterAlarm.js
Original file line number Diff line number Diff line change
Expand Up @@ -806,19 +806,19 @@ async function checkPendingAlarm(adapter, Shutter) {

const _statusAlarmWind1 = adapter.config.alarmWind1 != '' ? await adapter.getForeignStateAsync(adapter.config.alarmWind1)
.catch((e) => adapter.log.warn(`check pending alarm is not possible: ${e}`)) : null;
const statusAlarmWind1 = _statusAlarmWind1?.val !== null && _statusAlarmWind1?.val !== undefined ? _statusAlarmWind1.val : false;
const statusAlarmWind1 = _statusAlarmWind1 !== null && _statusAlarmWind1?.val !== undefined ? _statusAlarmWind1.val : false;

const _statusAlarmWind2 = adapter.config.alarmWind2 != '' ? await adapter.getForeignStateAsync(adapter.config.alarmWind2)
.catch((e) => adapter.log.warn(`check pending alarm is not possible: ${e}`)) : null;
const statusAlarmWind2 = _statusAlarmWind2?.val !== null && _statusAlarmWind1?.val !== undefined ? _statusAlarmWind2.val : false;
const statusAlarmWind2 = _statusAlarmWind2 !== null && _statusAlarmWind2?.val !== undefined ? _statusAlarmWind2.val : false;

const _statusAlarmRain = adapter.config.alarmRain != '' ? await adapter.getForeignStateAsync(adapter.config.alarmRain)
.catch((e) => adapter.log.warn(`check pending alarm is not possible: ${e}`)) : null;
const statusAlarmRain = _statusAlarmRain?.val !== null && _statusAlarmRain?.val !== undefined ? _statusAlarmRain.val : false;
const statusAlarmRain = _statusAlarmRain !== null && _statusAlarmRain?.val !== undefined ? _statusAlarmRain.val : false;

const _statusAlarmFire = adapter.config.alarmFire != '' ? await adapter.getForeignStateAsync(adapter.config.alarmFire)
.catch((e) => adapter.log.warn(`check pending alarm is not possible: ${e}`)) : null;
const statusAlarmFire = _statusAlarmFire?.val !== null && _statusAlarmFire?.val !== undefined ? _statusAlarmFire.val : false;
const statusAlarmFire = _statusAlarmFire !== null && _statusAlarmFire?.val !== undefined ? _statusAlarmFire.val : false;

// check if alarm ist pending for the given shutter and return true if yes
if ((statusAlarmWind1 == true &&
Expand Down
190 changes: 52 additions & 138 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"node": ">=18.0.0"
},
"dependencies": {
"@iobroker/adapter-core": "^3.2.1",
"@iobroker/adapter-core": "^3.2.2",
"node-schedule": "^2.1.1",
"suncalc": "^1.9.0"
},
Expand All @@ -45,7 +45,7 @@
"axios": "^1.7.7",
"chai": "^4.5.0",
"chai-as-promised": "^7.1.2",
"eslint": "^9.11.1",
"eslint": "^9.12.0",
"mocha": "^10.7.3",
"sinon": "^18.0.0",
"sinon-chai": "^3.7.0"
Expand Down

0 comments on commit 82f58ef

Please sign in to comment.