Skip to content

Commit

Permalink
### 0.7.5: Maintenance Release
Browse files Browse the repository at this point in the history
**Enhancements**

- Added NOAH.

**Fixes**

- Solved the problem that no inverter list but result 2 was returned in NOAH.
  • Loading branch information
PLCHome committed Aug 13, 2024
1 parent d3851fa commit 220d3d2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
### 0.7.5: Maintenance Release

**Enhancements**

- Added NOAH.

**Fixes**

- Solved the problem that no inverter list but result 2 was returned in NOAH.

### 0.7.4: Maintenance Release

**Fixes**
Expand Down
7 changes: 4 additions & 3 deletions lib/growatt.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,8 @@ module.exports = class growatt {
resolve(res.data);
} else if (res.data && res.data.result) {
debugApi('getDevicesByPlantList reject:', res.data);
reject(new Error(JSON.stringify(res.data, getJSONCircularReplacer())));
// reject(new Error(JSON.stringify(res.data, getJSONCircularReplacer())));
resolve({});
} else {
debugApi('getDevicesByPlantList reject');
if (res.request.path.match('errorMess')) {
Expand Down Expand Up @@ -386,10 +387,10 @@ module.exports = class growatt {
.then(res => {
debugVerbose('getDevicesByPlant result:', res);
if (res.data && res.data.result && res.data.result === 1) {
debugApi('getDevicesByPlant resolve:', res.data);
debugApi('getDevicesByPlant resolve:', JSON.stringify(res.data, getJSONCircularReplacer()));
resolve(res.data);
} else if (res.data && res.data.result) {
debugApi('getDevicesByPlant reject:', res.data);
debugApi('getDevicesByPlant reject:', JSON.stringify(res.data, getJSONCircularReplacer()));
reject(new Error(JSON.stringify(res.data, getJSONCircularReplacer())));
} else {
debugApi('getDevicesByPlant reject');
Expand Down
6 changes: 6 additions & 0 deletions lib/growatttype.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const TLXH = 'tlxh';
const STORAGE = 'storage';
const SPA = 'spa';
const HPS = 'hps';
const NOAH = 'noah';
const SINGLEBACKFLOW = 'singleBackflow';
const MULTIPLEBACKFLOW = 'multipleBackflow';

Expand Down Expand Up @@ -256,4 +257,9 @@ module.exports = {
getTotalData: '/panel/multipleBackflow/getMultipleBackflowTotalData',
getStatusData: '/panel/multipleBackflow/getMultipleBackflowStatusData',
},
[NOAH]: {
snParam: 'deviceSn',
getTotalData: '/device/getPlantTotalData',
getHistory: '/device/getNoahHistory',
},
};

0 comments on commit 220d3d2

Please sign in to comment.