Skip to content

Commit

Permalink
(simatec) Fix Trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
simatec committed Aug 12, 2024
1 parent 8c2cd9e commit 48d381d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ When the adapter crashes or an other Code error happens, this error message that
* (simatec) Fix Sunprotect end by Shutter up
* (simatec) Fix Shutter up when open the Window
* (simatec) Test & Release updated
* (simatec) Fix Trigger

### 1.7.3 (2024-06-20)
* (simatec) Fix Sunprotect End-Delay
Expand Down
5 changes: 3 additions & 2 deletions lib/triggerChange.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ async function sleep(ms) {
async function triggerChange(resTriggerChange, adapter, shutterSettings) {
if (shutterSettings) {
const arrayChangeTrigger = shutterSettings.filter((/** @type {{ triggerID: any; }} */ d) => d.triggerID == resTriggerChange); // Filter changed Trigger
const result = arrayChangeTrigger.filter((/** @type {{ enabled: boolean | string; }} */ d) => d.enabled === true || d.enabled === 'true'); // Filter enabled

for (const i in arrayChangeTrigger) {
for (const i in result) {
for (const s in shutterSettings) {
if (shutterSettings[s].shutterName == arrayChangeTrigger[i].shutterName) {
if (shutterSettings[s].shutterName == result[i].shutterName) {
if (shutterSettings[s].triggerChange == 'onlyUp' ||
shutterSettings[s].triggerChange == 'upDown' ||
(shutterSettings[s].triggerChange == 'off' && shutterSettings[s].driveAfterClose == true)) {
Expand Down

0 comments on commit 48d381d

Please sign in to comment.