Skip to content

Commit

Permalink
fixed #11
Browse files Browse the repository at this point in the history
  • Loading branch information
windka committed Mar 17, 2023
1 parent f0dddeb commit 70963b0
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Changelog
All notable changes to this project will be documented in this file.

## [0.15.1] [2023-03-17]
### fixed - [#11](https://github.com/windkh/node-red-contrib-grohe-sense/issues/11)

## [0.15.0] [2022-11-21]
### added more statistics to history data

Expand Down
14 changes: 14 additions & 0 deletions grohe/99-grohe.js
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,20 @@ module.exports = function (RED) {
}
}

// For Debugging only
if (msg.debug === true){
let debugMsg = {
debug : {
applianceIds : node.applianceIds,
info : info,
status : status,
notifications : notifications,
applianceData : data
}
};
node.warn(debugMsg);
}

let result = {};

if(info != null){
Expand Down
27 changes: 24 additions & 3 deletions grohe/ondusApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -420,13 +420,34 @@ function convertNotification(notification) {
431 : 'Water detected - water still ON',
},
},
// new unknown category, maybe info
40 : {
'text' : 'Info',
'type' : {
1 : 'Did you have a leak?',
},
},
},
};

let category = notification.category;
let type = notification.type;
let message = notificationMessageByCategoryAndType.category[category].type[type];
let categoryText = notificationMessageByCategoryAndType.category[category].text;

let categoryInfo = notificationMessageByCategoryAndType.category[category];

let message;
let categoryText;
if (categoryInfo !== undefined) {
message = categoryInfo.type[type];
categoryText = categoryInfo.text;
}
else {
categoryText = 'Unknown';
}

if (message === undefined) {
message = 'Unkown notification category: ' + category + ' type: ' + type;
}

let convertedNotification = {
category : categoryText,
Expand All @@ -442,7 +463,7 @@ let OndusType = {
Sense : 101,
SensePlus : 102,
SenseGuard : 103,
// BlueHome : 104 // TDOD
// BlueHome : 104 // TODO
};


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-red-contrib-grohe-sense",
"version": "0.15.0",
"version": "0.15.1",
"description": "Grohe sense nodes via ondus API.",
"node-red": {
"version": ">=0.1.0",
Expand Down

0 comments on commit 70963b0

Please sign in to comment.