@ray-js/ipc-player-integration 0.0.44 → 0.0.45-beta.1
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/index.d.ts +2 -0
- package/lib/hooks/index.js +2 -0
- package/lib/hooks/useEc/index.d.ts +1 -0
- package/lib/hooks/useEc/index.js +25 -0
- package/lib/hooks/useWaterTemperature/index.d.ts +1 -0
- package/lib/hooks/useWaterTemperature/index.js +23 -0
- package/lib/iconfont/iconfont.css +31 -3
- package/lib/iconfont/iconfont.js +8 -8
- package/lib/iconfont/iconfont.json +49 -0
- package/lib/iconfont/iconfont.ttf +0 -0
- package/lib/iconfont/iconfont.woff +0 -0
- package/lib/iconfont/iconfont.woff2 +0 -0
- package/lib/utils/content/dpCode.d.ts +2 -0
- package/lib/utils/content/dpCode.js +4 -0
- package/lib/widgets/tempHumidity/tempHumidity.js +57 -38
- package/lib/widgets/tempHumidity/tempHumidity.less +5 -0
- package/package.json +1 -1
package/lib/hooks/index.d.ts
CHANGED
package/lib/hooks/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useEc: (devId: string) => string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { useDpState } from '../useDpState';
|
|
3
|
+
import { IPC_EC } from '../../utils/content/dpCode';
|
|
4
|
+
import { showMathPowValue } from '../../utils/device';
|
|
5
|
+
export const useEc = devId => {
|
|
6
|
+
const [ec, setEc] = useState('');
|
|
7
|
+
const [dpState, schemaObj] = useDpState({
|
|
8
|
+
devId,
|
|
9
|
+
dpCodes: [IPC_EC]
|
|
10
|
+
});
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
var _schema$property;
|
|
13
|
+
if (dpState[IPC_EC] === undefined) {
|
|
14
|
+
setEc('');
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const schema = schemaObj === null || schemaObj === void 0 ? void 0 : schemaObj[IPC_EC];
|
|
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 = schema?.property?.unit || 'μS/cm';
|
|
20
|
+
const value = showMathPowValue(dpState[IPC_EC], scale);
|
|
21
|
+
// EC 值始终以整数形式展示(showMathPowValue 在 scale !== 0 时会保留一位小数,如 "0.0")
|
|
22
|
+
setEc(`${Math.round(Number(value))}`);
|
|
23
|
+
}, [dpState, schemaObj]);
|
|
24
|
+
return ec;
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useWaterTemperature: (devId: string) => string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { useDpState } from '../useDpState';
|
|
3
|
+
import { IPC_WATER_TEMPERATURE } from '../../utils/content/dpCode';
|
|
4
|
+
import { showMathPowValue } from '../../utils/device';
|
|
5
|
+
export const useWaterTemperature = devId => {
|
|
6
|
+
const [waterTemp, setWaterTemp] = useState('');
|
|
7
|
+
const [dpState, schemaObj] = useDpState({
|
|
8
|
+
devId,
|
|
9
|
+
dpCodes: [IPC_WATER_TEMPERATURE]
|
|
10
|
+
});
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
var _schema$property;
|
|
13
|
+
if (dpState[IPC_WATER_TEMPERATURE] === undefined) {
|
|
14
|
+
setWaterTemp('');
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const schema = schemaObj === null || schemaObj === void 0 ? void 0 : schemaObj[IPC_WATER_TEMPERATURE];
|
|
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 value = showMathPowValue(dpState[IPC_WATER_TEMPERATURE], scale);
|
|
20
|
+
setWaterTemp(`${value}°C`);
|
|
21
|
+
}, [dpState, schemaObj]);
|
|
22
|
+
return waterTemp;
|
|
23
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
@font-face {
|
|
2
2
|
font-family: "icon-panel"; /* Project id 4727767 */
|
|
3
|
-
src: url('iconfont.woff2?t=
|
|
4
|
-
url('iconfont.woff?t=
|
|
5
|
-
url('iconfont.ttf?t=
|
|
3
|
+
src: url('iconfont.woff2?t=1782702695877') format('woff2'),
|
|
4
|
+
url('iconfont.woff?t=1782702695877') format('woff'),
|
|
5
|
+
url('iconfont.ttf?t=1782702695877') format('truetype');
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
.icon-panel {
|
|
@@ -13,6 +13,34 @@
|
|
|
13
13
|
-moz-osx-font-smoothing: grayscale;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
.icon-panel-lvye1:before {
|
|
17
|
+
content: "\e6ce";
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.icon-panel-lvye:before {
|
|
21
|
+
content: "\e6cd";
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.icon-panel-zhiwujilu:before {
|
|
25
|
+
content: "\e6cc";
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.icon-panel-shuiwei:before {
|
|
29
|
+
content: "\e6c8";
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.icon-panel-ECzhi:before {
|
|
33
|
+
content: "\e6c9";
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.icon-panel-dengguang:before {
|
|
37
|
+
content: "\e6ca";
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.icon-panel-zongkaiguan:before {
|
|
41
|
+
content: "\e6cb";
|
|
42
|
+
}
|
|
43
|
+
|
|
16
44
|
.icon-panel-zhinenghuazhi-guanbi:before {
|
|
17
45
|
content: "\e6c7";
|
|
18
46
|
}
|