From eb402f564606b7a3f498b3266bc10deee9c01872 Mon Sep 17 00:00:00 2001 From: tnn85 Date: Sun, 16 Apr 2023 05:33:57 +0200 Subject: [PATCH] Fixed Meter and Storage Data request Request for meter data is called GetMeterRealtimeData, not GetPowerMeterRealtimeData in Fronius Solar API V1. Also: GetMeterRealtimeData and GetStorageRealtimeData use ".cgi", not ".fcgi". Function rename for GetPowerFlowRealtimeData --- index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index 6ad5a19..09c8728 100644 --- a/index.js +++ b/index.js @@ -150,7 +150,7 @@ module.exports.GetComponentsData = function (options) { }) }; -module.exports.GetPowerFlowRealtimeDataData = function (options) { +module.exports.GetPowerFlowRealtimeData = function (options) { var opts = _.clone(options); return checkRequiredProperties(opts, ['host']).then(function () { return lastRequest = settlePromise(lastRequest).then(function () { @@ -161,12 +161,12 @@ module.exports.GetPowerFlowRealtimeDataData = function (options) { }) }; -module.exports.GetPowerMeterRealtimeData = function (options) { +module.exports.GetMeterRealtimeData = function (options) { var opts = _.clone(options); opts.scope = "Device"; return checkRequiredProperties(opts, ['host', 'deviceId']).then(function () { return lastRequest = settlePromise(lastRequest).then(function () { - return getRequest(opts, '/solar_api/v1/GetPowerMeterRealtimeData.fcgi').then(function (json) { + return getRequest(opts, '/solar_api/v1/GetMeterRealtimeData.cgi').then(function (json) { return Promise.resolve(json); }) }) @@ -178,9 +178,9 @@ module.exports.GetStorageRealtimeData = function (options) { opts.scope = "Device"; return checkRequiredProperties(opts, ['host', 'deviceId']).then(function () { return lastRequest = settlePromise(lastRequest).then(function () { - return getRequest(opts, '/solar_api/v1/GetStorageRealtimeData.fcgi').then(function (json) { + return getRequest(opts, '/solar_api/v1/GetStorageRealtimeData.cgi').then(function (json) { return Promise.resolve(json); }) }) }) -}; \ No newline at end of file +};