Socket
Socket
Sign inDemoInstall

node-red-contrib-dashboard-bar-chart-data

Package Overview
Dependencies
0
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.9.8 to 0.9.9

19

bar-chart-data.js

@@ -18,2 +18,4 @@ module.exports = function(RED) {

clearNode(msg,this,store);
else if (msg.payload.toString().split(' ')[0] === 'set_meter_value')
setMeterValue(msg,this,store);
else if (msg.hasOwnProperty("bar_keys")) //restore

@@ -30,2 +32,19 @@ restoreNode(msg,this,store);

function setMeterValue(msg, myNode, store) {
if(msg.topic == '') {
myNode.error('topic is missing, cannot set the new meter value');
return;
}
let newValue = Number(msg.payload.split(' ')[1]);
if(isNaN(newValue)) {
myNode.error('new meter value is missing, use for example "set_meter_value 123.45"');
return;
}
store.set(msg.topic + '_last', newValue);
msg.payload = {};
msg.info = 'new meter value is ' + newValue + ' for ' + msg.topic;
}
function clearNode(msg, myNode, store) {

@@ -32,0 +51,0 @@ var topics = store.get('topics')||[];

2

package.json
{
"name": "node-red-contrib-dashboard-bar-chart-data",
"version": "0.9.8",
"version": "0.9.9",
"description": "Transforms sensor measurements or meter readings to be displayed in dashboard-chart as bar-chart",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/arneman/node-red-contrib-dashboard-bar-chart-data",

@@ -69,2 +69,10 @@ # node-red-contrib-dashboard-bar-chart-data

<h3>Set (start) meter value</h3>
<dl>
<dd>A message with the payload "set_meter_value 123.45" will set the (start) value for the topic to <code>123.45</code>.
The calculation of the difference between the new and the previous meter reading value will be skipped. You can use
this when your old meter is replaced with a new one and the values begins from 0 (again).
</dd>
</dl>
<h3>Restore</h3>

@@ -71,0 +79,0 @@ <dl>

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc