@enyo-energy/sunspec-sdk 0.0.41 → 0.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -670,26 +670,26 @@ class SunspecModbusClient {
|
|
|
670
670
|
// Log the raw and scaled values
|
|
671
671
|
if (offset !== undefined && modelId !== undefined && fieldName) {
|
|
672
672
|
const hex = value >= 0 ? value.toString(16).toUpperCase() : (value >>> 0).toString(16).toUpperCase();
|
|
673
|
-
console.
|
|
673
|
+
console.debug(`[Model ${modelId}] offset ${offset}: ${fieldName} raw=${value} (0x${hex}), SF=${scaleFactor}, scaled=${scaledValue}`);
|
|
674
674
|
}
|
|
675
675
|
else {
|
|
676
676
|
const fieldPrefix = fieldName ? `${fieldName}: ` : '';
|
|
677
|
-
console.
|
|
677
|
+
console.debug(`Scale Factor Applied - ${fieldPrefix}raw=${value} (decimal), SF=${scaleFactor}, scaled=${scaledValue}`);
|
|
678
678
|
}
|
|
679
679
|
return scaledValue;
|
|
680
680
|
}
|
|
681
681
|
logRegisterRead(modelId, offset, fieldName, rawValue, dataType) {
|
|
682
682
|
const typeInfo = dataType ? ` (${dataType})` : '';
|
|
683
683
|
if (rawValue === undefined) {
|
|
684
|
-
console.
|
|
684
|
+
console.debug(`[Model ${modelId}] offset ${offset}: ${fieldName} = -${typeInfo}`);
|
|
685
685
|
return;
|
|
686
686
|
}
|
|
687
687
|
if (typeof rawValue === 'number') {
|
|
688
688
|
const hex = rawValue >= 0 ? rawValue.toString(16).toUpperCase() : (rawValue >>> 0).toString(16).toUpperCase();
|
|
689
|
-
console.
|
|
689
|
+
console.debug(`[Model ${modelId}] offset ${offset}: ${fieldName} = ${rawValue} (0x${hex})${typeInfo}`);
|
|
690
690
|
}
|
|
691
691
|
else {
|
|
692
|
-
console.
|
|
692
|
+
console.debug(`[Model ${modelId}] offset ${offset}: ${fieldName} = "${rawValue}"${typeInfo}`);
|
|
693
693
|
}
|
|
694
694
|
}
|
|
695
695
|
/**
|
package/dist/cjs/version.cjs
CHANGED
|
@@ -9,7 +9,7 @@ exports.getSdkVersion = getSdkVersion;
|
|
|
9
9
|
/**
|
|
10
10
|
* Current version of the enyo Energy App SDK.
|
|
11
11
|
*/
|
|
12
|
-
exports.SDK_VERSION = '0.0.
|
|
12
|
+
exports.SDK_VERSION = '0.0.42';
|
|
13
13
|
/**
|
|
14
14
|
* Gets the current SDK version.
|
|
15
15
|
* @returns The semantic version string of the SDK
|
package/dist/cjs/version.d.cts
CHANGED
|
@@ -667,26 +667,26 @@ export class SunspecModbusClient {
|
|
|
667
667
|
// Log the raw and scaled values
|
|
668
668
|
if (offset !== undefined && modelId !== undefined && fieldName) {
|
|
669
669
|
const hex = value >= 0 ? value.toString(16).toUpperCase() : (value >>> 0).toString(16).toUpperCase();
|
|
670
|
-
console.
|
|
670
|
+
console.debug(`[Model ${modelId}] offset ${offset}: ${fieldName} raw=${value} (0x${hex}), SF=${scaleFactor}, scaled=${scaledValue}`);
|
|
671
671
|
}
|
|
672
672
|
else {
|
|
673
673
|
const fieldPrefix = fieldName ? `${fieldName}: ` : '';
|
|
674
|
-
console.
|
|
674
|
+
console.debug(`Scale Factor Applied - ${fieldPrefix}raw=${value} (decimal), SF=${scaleFactor}, scaled=${scaledValue}`);
|
|
675
675
|
}
|
|
676
676
|
return scaledValue;
|
|
677
677
|
}
|
|
678
678
|
logRegisterRead(modelId, offset, fieldName, rawValue, dataType) {
|
|
679
679
|
const typeInfo = dataType ? ` (${dataType})` : '';
|
|
680
680
|
if (rawValue === undefined) {
|
|
681
|
-
console.
|
|
681
|
+
console.debug(`[Model ${modelId}] offset ${offset}: ${fieldName} = -${typeInfo}`);
|
|
682
682
|
return;
|
|
683
683
|
}
|
|
684
684
|
if (typeof rawValue === 'number') {
|
|
685
685
|
const hex = rawValue >= 0 ? rawValue.toString(16).toUpperCase() : (rawValue >>> 0).toString(16).toUpperCase();
|
|
686
|
-
console.
|
|
686
|
+
console.debug(`[Model ${modelId}] offset ${offset}: ${fieldName} = ${rawValue} (0x${hex})${typeInfo}`);
|
|
687
687
|
}
|
|
688
688
|
else {
|
|
689
|
-
console.
|
|
689
|
+
console.debug(`[Model ${modelId}] offset ${offset}: ${fieldName} = "${rawValue}"${typeInfo}`);
|
|
690
690
|
}
|
|
691
691
|
}
|
|
692
692
|
/**
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enyo-energy/sunspec-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.42",
|
|
4
4
|
"description": "enyo Energy Sunspec SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"typescript": "^5.8.3"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@enyo-energy/energy-app-sdk": "^0.0.
|
|
40
|
+
"@enyo-energy/energy-app-sdk": "^0.0.85"
|
|
41
41
|
},
|
|
42
42
|
"volta": {
|
|
43
43
|
"node": "22.17.0"
|