Skip to content

Commit

Permalink
#10 Added useChannels config. False by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
raintonr committed Dec 27, 2022
1 parent e7cc55e commit bd97b80
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
11 changes: 8 additions & 3 deletions admin/index_m.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,21 @@
</div>
</div>

<!-- Put your content here -->

<!-- For example columns with settings: -->
<div class="row">
<div class="col s6 input-field">
<input type="text" class="value" id="port" />
<label for="option2" class="translate">Listen port</label>
</div>
</div>

<div class="row">
<div class="col s6 input-field">
<input type="checkbox" class="value" id="useChannels" />
<span class="translate">Create channels below devices</span>
<br/>
<span class="translate">Useful if you have devices that have more than one sensor.</span>
</div>
</div>
</div>

</body>
Expand Down
3 changes: 2 additions & 1 deletion io-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@
]
},
"native": {
"port": 8089
"port": 8089,
"useChannels": false
},
"objects": [],
"instanceObjects": []
Expand Down
2 changes: 1 addition & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ class HikvisionAlarmserver extends utils.Adapter {
}

// Channel name is optional
const channelName = xml.EventNotificationAlert.hasOwnProperty('channelName') ?
const channelName = this.config.useChannels && xml.EventNotificationAlert.hasOwnProperty('channelName') ?
xml.EventNotificationAlert.channelName[0] : null;

// Strip colons from ID to be consistent with net-tools
Expand Down

0 comments on commit bd97b80

Please sign in to comment.