summaryrefslogtreecommitdiffstats
path: root/node.d
diff options
context:
space:
mode:
authorBrainDoctor <github.account@chrigel.net>2017-07-05 21:01:46 +0200
committerBrainDoctor <github.account@chrigel.net>2017-07-05 21:01:46 +0200
commit45a8c0707bb7d43c9f7c257216ba9fce34993931 (patch)
treeddfd28ffa916d9ed88ad3b53c11dd44c63aaef9b /node.d
parentc6341707a614f05beee7cfa66dce2bfab83eb474 (diff)
Removing const's because of strict mode.
Diffstat (limited to 'node.d')
-rw-r--r--node.d/fronius.node.js38
1 files changed, 19 insertions, 19 deletions
diff --git a/node.d/fronius.node.js b/node.d/fronius.node.js
index 757e4da5ea..5a8d95b7cf 100644
--- a/node.d/fronius.node.js
+++ b/node.d/fronius.node.js
@@ -11,13 +11,6 @@ var netdata = require('netdata');
netdata.debug('loaded ' + __filename + ' plugin');
-const powerGridId = 'p_grid';
-const powerPvId = 'p_pv';
-const powerAccuId = 'p_akku'; // not my typo! Using the ID from the API
-const consumptionLoadId = 'p_load';
-const autonomyId = 'rel_autonomy';
-const consumptionSelfId = 'rel_selfconsumption';
-
var fronius = {
name: "Fronius",
enable_autodetect: false,
@@ -25,6 +18,13 @@ var fronius = {
base_priority: 60000,
charts: {},
+ powerGridId: "p_grid",
+ powerPvId: 'p_pv',
+ powerAccuId: 'p_akku', // not my typo! Using the ID from the AP
+ consumptionLoadId: 'p_load',
+ autonomyId: 'rel_autonomy',
+ consumptionSelfId: 'rel_selfconsumption',
+
createBasicDimension(id, name) {
return {
id: id, // the unique id of the dimension
@@ -43,9 +43,9 @@ var fronius = {
if (fronius.isDefined(chart)) return chart;
var dim = {};
- dim[powerGridId] = this.createBasicDimension(powerGridId, "Grid");
- dim[powerPvId] = this.createBasicDimension(powerPvId, "Photovoltaics");
- dim[powerAccuId] = this.createBasicDimension(powerAccuId, "Accumulator");
+ dim[fronius.powerGridId] = this.createBasicDimension(fronius.powerGridId, "Grid");
+ dim[fronius.powerPvId] = this.createBasicDimension(fronius.powerPvId, "Photovoltaics");
+ dim[fronius.powerAccuId] = this.createBasicDimension(fronius.powerAccuId, "Accumulator");
chart = {
id: id, // the unique id of the chart
@@ -71,7 +71,7 @@ var fronius = {
var chart = fronius.charts[id];
if (fronius.isDefined(chart)) return chart;
var dim = {};
- dim[consumptionLoadId] = this.createBasicDimension(consumptionLoadId, "Load");
+ dim[fronius.consumptionLoadId] = this.createBasicDimension(fronius.consumptionLoadId, "Load");
chart = {
id: id, // the unique id of the chart
@@ -97,8 +97,8 @@ var fronius = {
var chart = fronius.charts[id];
if (fronius.isDefined(chart)) return chart;
var dim = {};
- dim[autonomyId] = this.createBasicDimension(autonomyId, "Autonomy");
- dim[consumptionSelfId] = this.createBasicDimension(consumptionSelfId, "Self Consumption");
+ dim[fronius.autonomyId] = this.createBasicDimension(fronius.autonomyId, "Autonomy");
+ dim[fronius.consumptionSelfId] = this.createBasicDimension(fronius.consumptionSelfId, "Self Consumption");
chart = {
id: id, // the unique id of the chart
@@ -220,9 +220,9 @@ var fronius = {
// Site Current Power Chart
service.begin(fronius.getSitePowerChart(service, 'fronius_' + service.name + '.power'));
- service.set(powerGridId, Math.round(site.P_Grid));
- service.set(powerPvId, Math.round(site.P_PV));
- service.set(powerAccuId, Math.round(site.P_Akku));
+ service.set(fronius.powerGridId, Math.round(site.P_Grid));
+ service.set(fronius.powerPvId, Math.round(site.P_PV));
+ service.set(fronius.powerAccuId, Math.round(site.P_Akku));
service.end();
// Site Consumption Chart
@@ -231,13 +231,13 @@ var fronius = {
consumption *= -1;
service.begin(fronius.getSiteConsumptionChart(service, 'fronius_' + service.name + '.consumption'));
- service.set(consumptionLoadId, Math.round(consumption));
+ service.set(fronius.consumptionLoadId, Math.round(consumption));
service.end();
// Site Autonomy Chart
service.begin(fronius.getSiteAutonomyChart(service, 'fronius_' + service.name + '.autonomy'));
- service.set(autonomyId, Math.round(site.rel_Autonomy));
- service.set(consumptionSelfId, Math.round(site.rel_SelfConsumption));
+ service.set(fronius.autonomyId, Math.round(site.rel_Autonomy));
+ service.set(fronius.consumptionSelfId, Math.round(site.rel_SelfConsumption));
service.end();
// Inverters