Skip to content

Commit

Permalink
Validate user inputs in instance configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
klein0r committed Aug 12, 2024
1 parent 4cf389c commit 6c70d88
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ iobroker add trashschedule
Placeholder for the next version (at the beginning of the line):
### **WORK IN PROGRESS**
-->
### **WORK IN PROGRESS**

* (@klein0r) Validate user inputs in instance configuration

### 3.3.0 (2024-04-28)

NodeJS >= 18.x and js-controller >= 5 is required
Expand Down
5 changes: 4 additions & 1 deletion admin/jsonConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@
"md": 6,
"lg": 6,
"label": "skip same day at hour",
"help": "skip same day at hour help"
"help": "skip same day at hour help",
"min": 0,
"max": 23,
"step": 1
},
"daysuntilaction": {
"newLine": true,
Expand Down
4 changes: 4 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,10 @@ class Trashschedule extends utils.Adapter {
const globalOffset = this.config.globaloffset || 0;
const skipsamedayathour = this.config.skipsamedayathour || 18;

if (skipsamedayathour > 23 || skipsamedayathour < 0) {
this.log.warn(`Skip same day at hour has an invalid configuration: ${skipsamedayathour}. Select a value between 0 and 23 in instance settings`);
}

const jsonSummary = [];
const filledTypes = [];

Expand Down

0 comments on commit 6c70d88

Please sign in to comment.