Skip to content

Commit

Permalink
Fix in showing Values
Browse files Browse the repository at this point in the history
On first creation of the victron-client, the showValues and
contextStore get defaults.
Updated examples.
  • Loading branch information
dirkjanfaber committed Nov 7, 2024
1 parent 4406fd1 commit 1ce472e
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/Virtual Device: grid.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"id": "82af4d599bf0380c",
"type": "Virtual Device",
"type": "victron-virtual",
"z": "456c3da89ebad689",
"name": "P1",
"device": "grid",
Expand Down
2 changes: 1 addition & 1 deletion examples/Virtual Device: meteo.json
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@
},
{
"id": "965441bc584a2726",
"type": "Virtual Device",
"type": "victron-virtual",
"z": "de710832a415f877",
"name": "",
"device": "meteo",
Expand Down
2 changes: 1 addition & 1 deletion examples/Virtual Device: tank.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"id": "f5bdb1bb02f4d6dc",
"type": "Virtual Device",
"type": "victron-virtual",
"z": "a442aa86b4030805",
"name": "Water",
"device": "tank",
Expand Down
2 changes: 1 addition & 1 deletion src/nodes/config-client.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
category: 'config',
color: '#a6bbcf',
defaults: {
showValues: { value: false },
showValues: { value: true },
contextStore: {value: true }
},
label: function label() {
Expand Down
4 changes: 3 additions & 1 deletion src/nodes/victron-nodes.html
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,9 @@
id: "victron-client-id",
_def: RED.nodes.getType("victron-client"),
type: "victron-client",
users: []
users: [],
"showValues": true,
"contextStore": true
};
RED.nodes.add(victronClientNode);
RED.nodes.dirty(true);
Expand Down
2 changes: 1 addition & 1 deletion src/nodes/victron-nodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ module.exports = function (RED) {
if (this.pathObj.type === 'enum') {
text = `${value} (${this.pathObj.enum[value]})`
}
if (this.configNode && this.configNode.showValues) {
if (this.configNode && (this.configNode.showValues || typeof this.configNode.showValues === 'undefined')) {
this.node.status({ fill: 'green', shape, text })
}
}
Expand Down

0 comments on commit 1ce472e

Please sign in to comment.