Skip to content

Commit 82a3218

Browse files
authored
Merge pull request #897 from telefonicaid/fix/cmd_notification_when_mode_notification
fix for cmdMode = notification
2 parents 699b091 + 2078f09 commit 82a3218

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

CHANGES_NEXT_RELEASE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1+
- Fix: receive and store cmd notification when command mode is notification

lib/bindings/HTTPBinding.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -825,9 +825,14 @@ function notificationHandler(device, values, callback) {
825825
if (!error) {
826826
group = foundGroup;
827827
}
828+
828829
var cmdValue = { type: 'command' };
829830
for (let val of values) {
830-
if (val.name === 'cmd') {
831+
// Notified by a cmdMode = notification
832+
if (val.type === 'command') {
833+
cmdValue = val;
834+
} else if (val.name === 'cmd') {
835+
// Notified by a cmdMode = advancedNotification
831836
cmdValue.name = val.value;
832837
} else if (val.name === 'params') {
833838
cmdValue.value = val.value;

0 commit comments

Comments
 (0)