Skip to content

Commit

Permalink
0.1.1 exlcude devices
Browse files Browse the repository at this point in the history
  • Loading branch information
TA2k committed Oct 29, 2023
1 parent 79a481e commit 41eede2
Show file tree
Hide file tree
Showing 5 changed files with 252 additions and 189 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ Thumbs.db

# i18n intermediate files
admin/i18n/flat.txt
admin/i18n/*/flat.txt
admin/i18n/*/flat.txt
.DS_Store
6 changes: 5 additions & 1 deletion io-package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
{
"common": {
"name": "smartthings",
"version": "0.1.0",
"version": "0.1.1",
"news": {
"0.1.1": {
"en": "Added support to exclude devices",
"de": "Unterstützung zum Ausschließen von Geräten hinzugefügt"
},
"0.1.0": {
"en": "Added object excluding to reduce cpu usage",
"de": "Objekt-Exklusion hinzugefügt, um die CPU-Auslastung zu reduzieren"
Expand Down
4 changes: 2 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ class Smartthings extends utils.Adapter {
this.log.info(res.data.items.length + " devices detected");
for (const device of res.data.items) {
const exlcudeList = this.config.excludeDevices.replace(/ /g, "").split(",");
if (exlcudeList.includes(device.deviceId)) {
this.log.info("Exclude " + device.deviceId);
if (exlcudeList && exlcudeList.includes(device.deviceId)) {
this.log.info("Ignore " + device.deviceId);
continue;
}
this.deviceArray.push({ id: device.deviceId, type: device.deviceTypeName });
Expand Down
Loading

0 comments on commit 41eede2

Please sign in to comment.