@ray-js/ipc-player-integration 0.0.43-beta.1 → 0.0.43-beta.3
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.
- package/lib/hooks/useEc/index.js +4 -3
- package/package.json +1 -1
package/lib/hooks/useEc/index.js
CHANGED
|
@@ -9,16 +9,17 @@ export const useEc = devId => {
|
|
|
9
9
|
dpCodes: [IPC_EC]
|
|
10
10
|
});
|
|
11
11
|
useEffect(() => {
|
|
12
|
-
var _schema$property
|
|
12
|
+
var _schema$property;
|
|
13
13
|
if (dpState[IPC_EC] === undefined) {
|
|
14
14
|
setEc('');
|
|
15
15
|
return;
|
|
16
16
|
}
|
|
17
17
|
const schema = schemaObj === null || schemaObj === void 0 ? void 0 : schemaObj[IPC_EC];
|
|
18
18
|
const scale = (schema === null || schema === void 0 || (_schema$property = schema.property) === null || _schema$property === void 0 ? void 0 : _schema$property.scale) || 0;
|
|
19
|
-
const unit =
|
|
19
|
+
// const unit = schema?.property?.unit || 'μS/cm';
|
|
20
20
|
const value = showMathPowValue(dpState[IPC_EC], scale);
|
|
21
|
-
|
|
21
|
+
// EC 值始终以整数形式展示(showMathPowValue 在 scale !== 0 时会保留一位小数,如 "0.0")
|
|
22
|
+
setEc(`${Math.round(Number(value))}`);
|
|
22
23
|
}, [dpState, schemaObj]);
|
|
23
24
|
return ec;
|
|
24
25
|
};
|