@ray-js/ipc-player-integration 0.0.44 → 0.0.45-beta.2
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 +5 -0
- package/lib/hooks/useWaterTemperature/index.js +38 -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 +3 -0
- package/lib/utils/content/dpCode.js +6 -0
- package/lib/widgets/tempHumidity/tempHumidity.js +61 -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,38 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { useDpState } from '../useDpState';
|
|
3
|
+
import { TEMP_UNIT_SELECT, IPC_WATER_TEMPERATURE, IPC_WATER_TEMPERATURE_F } from '../../utils/content/dpCode';
|
|
4
|
+
import { showMathPowValue } from '../../utils/device';
|
|
5
|
+
export const useWaterTemperature = devId => {
|
|
6
|
+
const [tempUnit, setTempUnit] = useState('');
|
|
7
|
+
const [waterTempC, setWaterTempC] = useState('');
|
|
8
|
+
const [waterTempF, setWaterTempF] = useState('');
|
|
9
|
+
const [dpState, schemaObj] = useDpState({
|
|
10
|
+
devId,
|
|
11
|
+
dpCodes: [TEMP_UNIT_SELECT, IPC_WATER_TEMPERATURE, IPC_WATER_TEMPERATURE_F]
|
|
12
|
+
});
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
// 1=华氏度 0=摄氏度
|
|
15
|
+
if (dpState[TEMP_UNIT_SELECT] !== undefined) {
|
|
16
|
+
setTempUnit(dpState[TEMP_UNIT_SELECT] + '');
|
|
17
|
+
}
|
|
18
|
+
if (dpState[IPC_WATER_TEMPERATURE] !== undefined) {
|
|
19
|
+
var _schema$property;
|
|
20
|
+
const schema = schemaObj && schemaObj[IPC_WATER_TEMPERATURE];
|
|
21
|
+
const scale = (schema === null || schema === void 0 || (_schema$property = schema.property) === null || _schema$property === void 0 ? void 0 : _schema$property.scale) || 0;
|
|
22
|
+
const value = showMathPowValue(dpState[IPC_WATER_TEMPERATURE], scale);
|
|
23
|
+
setWaterTempC(value + '°C');
|
|
24
|
+
}
|
|
25
|
+
if (dpState[IPC_WATER_TEMPERATURE_F] !== undefined) {
|
|
26
|
+
var _schema$property2;
|
|
27
|
+
const schema = schemaObj && schemaObj[IPC_WATER_TEMPERATURE_F];
|
|
28
|
+
const scale = (schema === null || schema === void 0 || (_schema$property2 = schema.property) === null || _schema$property2 === void 0 ? void 0 : _schema$property2.scale) || 0;
|
|
29
|
+
const value = showMathPowValue(dpState[IPC_WATER_TEMPERATURE_F], scale);
|
|
30
|
+
setWaterTempF(value + '°F');
|
|
31
|
+
}
|
|
32
|
+
}, [dpState]);
|
|
33
|
+
return {
|
|
34
|
+
tempUnit,
|
|
35
|
+
waterTempC,
|
|
36
|
+
waterTempF
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -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
|
}
|