@ledvance/ui-biz-bundle 1.1.142 → 1.1.144
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/package.json +1 -1
- package/src/hooks/DeviceDpStateHooks.ts +1 -1
- package/src/modules/flags/FlagPage.tsx +4 -1
- package/src/modules/timeSchedule/TimeScheduleEditpage.tsx +1 -1
- package/src/modules/timer/TimerPage.tsx +1 -1
- package/src/newModules/biorhythm/BiorhythmActions.ts +403 -451
- package/src/newModules/biorhythm/BiorhythmBean.ts +230 -230
- package/src/newModules/biorhythm/BiorhythmEditPage.tsx +18 -20
- package/src/newModules/biorhythm/BiorhythmPage.tsx +653 -698
- package/src/newModules/biorhythm/IconSelect.tsx +88 -88
- package/src/newModules/biorhythm/Router.ts +33 -33
- package/src/newModules/biorhythm/iconListData.ts +30 -30
- package/src/newModules/biorhythm/pIdList.ts +35 -35
- package/src/newModules/energyConsumption/EnergyConsumptionActions.ts +67 -28
- package/src/newModules/energyConsumption/EnergyConsumptionCard.tsx +172 -0
- package/src/newModules/energyConsumption/EnergyConsumptionChart.tsx +234 -118
- package/src/newModules/energyConsumption/EnergyConsumptionDetail.tsx +3 -0
- package/src/newModules/energyConsumption/EnergyConsumptionPage.tsx +16 -0
- package/src/newModules/energyConsumption/co2Data.ts +5 -0
- package/src/newModules/energyConsumption/component/NewBarChart.tsx +172 -168
- package/src/newModules/energyConsumption/component/PowerLineChart.tsx +101 -0
- package/src/newModules/energyConsumption/res/energy-chart.png +0 -0
- package/src/newModules/energyConsumption/res/index.ts +3 -0
- package/src/newModules/fixedTime/FixedTimeDetailPage.tsx +1 -1
- package/src/newModules/sleepWakeUp/SleepWakeUpDetailPage.tsx +1 -1
- package/src/newModules/swithInching/SwithInching.tsx +1 -1
- package/src/newModules/timeSchedule/TimeScheduleActions.ts +12 -12
- package/tsconfig.json +73 -46
|
@@ -1,179 +1,183 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import ECharts from '@ledvance/react-native-echarts-pro'
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {Utils} from
|
|
7
|
-
import {OverviewItem} from
|
|
1
|
+
import ThemeType from '@ledvance/base/src/config/themeType'
|
|
2
|
+
import I18n from '@ledvance/base/src/i18n'
|
|
3
|
+
import ECharts from '@ledvance/react-native-echarts-pro'
|
|
4
|
+
import React, { useMemo, useRef } from 'react'
|
|
5
|
+
import { View } from 'react-native'
|
|
6
|
+
import { Utils } from 'tuya-panel-kit'
|
|
7
|
+
import { OverviewItem } from '../EnergyConsumptionPage'
|
|
8
|
+
|
|
9
|
+
const { withTheme } = Utils.ThemeUtils
|
|
10
|
+
const cx = Utils.RatioUtils.convertX
|
|
8
11
|
|
|
9
|
-
const {withTheme} = Utils.ThemeUtils
|
|
10
|
-
const cx = Utils.RatioUtils.convertX;
|
|
11
12
|
interface BarChartProps {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
theme?: ThemeType
|
|
14
|
+
data: OverviewItem[],
|
|
15
|
+
price: number,
|
|
16
|
+
unit: string,
|
|
17
|
+
height: number,
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
const BarChartWithTouch = (props: BarChartProps) => {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
21
|
+
const echarts = useRef()
|
|
22
|
+
const { data, height, price, unit, theme } = props
|
|
23
|
+
const dataX = data?.map(item => {
|
|
24
|
+
return item.chartTitle
|
|
25
|
+
})
|
|
26
|
+
const dataKwhY = data?.map(item => {
|
|
27
|
+
return Number(item.value)
|
|
28
|
+
})
|
|
29
|
+
const dataPriceY = data?.map(item => {
|
|
30
|
+
return ((isNaN(Number(item.value)) ? 0 : Number(item.value)) * price).toFixed(2)
|
|
31
|
+
})
|
|
32
|
+
const maxValue = useMemo(() => {
|
|
33
|
+
let max = Math.max(...dataKwhY)
|
|
34
|
+
if (max < 0.1) {
|
|
35
|
+
max += 0.02
|
|
36
|
+
max = max - (max % 0.02)
|
|
37
|
+
} else if (max < 1) {
|
|
38
|
+
max += 0.2
|
|
39
|
+
max = max - (max % 0.2)
|
|
40
|
+
} else if (max < 10) {
|
|
41
|
+
max = Math.ceil(max) + 2
|
|
42
|
+
max = max - (max % 2)
|
|
43
|
+
}
|
|
44
|
+
return max
|
|
45
|
+
}, [dataKwhY])
|
|
46
|
+
|
|
47
|
+
const gridRight = useMemo(() => {
|
|
48
|
+
const max = Math.max(...dataPriceY.map(it => Number(it)))
|
|
49
|
+
return max > 999 ? '15%' : '10%'
|
|
50
|
+
}, [dataPriceY])
|
|
51
|
+
const option = {
|
|
52
|
+
tooltip: {
|
|
53
|
+
show: true,
|
|
54
|
+
triggerOn: 'click',
|
|
55
|
+
trigger: 'axis',
|
|
56
|
+
},
|
|
57
|
+
legend: {
|
|
58
|
+
show: true,
|
|
59
|
+
data: ['kWh', unit],
|
|
60
|
+
textStyle: {
|
|
61
|
+
color: theme?.global.fontColor,
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
grid: {
|
|
65
|
+
right: gridRight,
|
|
66
|
+
},
|
|
67
|
+
xAxis: {
|
|
68
|
+
data: dataX,
|
|
69
|
+
axisTick: {
|
|
70
|
+
show: false,
|
|
71
|
+
},
|
|
72
|
+
axisLabel: {
|
|
73
|
+
show: true,
|
|
74
|
+
color: props.theme?.global.secondFontColor,
|
|
75
|
+
interval: 'auto',
|
|
76
|
+
rotate: 45,
|
|
77
|
+
align: 'right',
|
|
78
|
+
verticalAlign: 'top'
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
yAxis: [{
|
|
82
|
+
type: 'value',
|
|
83
|
+
name: I18n.getLang('consumption_data_annual_bar_chart_text'),
|
|
84
|
+
max: Math.max(maxValue, 0.02),
|
|
85
|
+
min: 0,
|
|
86
|
+
position: 'left',
|
|
87
|
+
axisLabel: {
|
|
88
|
+
formatter: function (value) {
|
|
89
|
+
const kwh = parseFloat(value)
|
|
90
|
+
let toFixed = 2
|
|
91
|
+
if (kwh >= 100) {
|
|
92
|
+
toFixed = 0
|
|
93
|
+
} else if (kwh >= 10) {
|
|
94
|
+
toFixed = 1
|
|
95
|
+
}
|
|
96
|
+
return kwh.toFixed(toFixed)
|
|
61
97
|
},
|
|
62
|
-
|
|
63
|
-
|
|
98
|
+
color: props.theme?.global.secondFontColor,
|
|
99
|
+
},
|
|
100
|
+
nameTextStyle: {
|
|
101
|
+
fontSize: 14,
|
|
102
|
+
align: 'left',
|
|
103
|
+
padding: [0, 0, 0, cx(-30)],
|
|
104
|
+
color: props.theme?.global.secondFontColor,
|
|
105
|
+
},
|
|
106
|
+
}, {
|
|
107
|
+
type: 'value',
|
|
108
|
+
name: I18n.formatValue('format_unit', unit),
|
|
109
|
+
position: 'right',
|
|
110
|
+
alignTicks: true,
|
|
111
|
+
max: Math.ceil(price ? maxValue * price * 1.4 : 0),
|
|
112
|
+
min: 0,
|
|
113
|
+
minInterval: 1,
|
|
114
|
+
axisLabel: {
|
|
115
|
+
formatter: function (value) {
|
|
116
|
+
const price = parseFloat(value)
|
|
117
|
+
let toFixed = 2
|
|
118
|
+
if (price >= 100) {
|
|
119
|
+
toFixed = 0
|
|
120
|
+
} else if (price >= 10) {
|
|
121
|
+
toFixed = 1
|
|
122
|
+
}
|
|
123
|
+
return price.toFixed(toFixed)
|
|
64
124
|
},
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
125
|
+
color: props.theme?.global.secondFontColor,
|
|
126
|
+
},
|
|
127
|
+
nameTextStyle: {
|
|
128
|
+
fontSize: 14,
|
|
129
|
+
align: 'right',
|
|
130
|
+
padding: [0, cx(-30), 0, 0],
|
|
131
|
+
color: props.theme?.global.secondFontColor,
|
|
132
|
+
},
|
|
133
|
+
}],
|
|
134
|
+
series: [
|
|
135
|
+
{
|
|
136
|
+
name: 'kWh',
|
|
137
|
+
type: 'bar',
|
|
138
|
+
data: dataKwhY,
|
|
139
|
+
itemStyle: {
|
|
140
|
+
emphasis: {
|
|
141
|
+
color: '#FFC2A9', // Color when bar is clicked
|
|
142
|
+
},
|
|
143
|
+
color: '#FFC2A9',
|
|
144
|
+
borderRadius: 2,
|
|
75
145
|
},
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
position: 'left',
|
|
82
|
-
axisLabel: {
|
|
83
|
-
formatter: function (value) {
|
|
84
|
-
const kwh=parseFloat(value);
|
|
85
|
-
let toFixed = 2;
|
|
86
|
-
if (kwh >= 100) {
|
|
87
|
-
toFixed = 0;
|
|
88
|
-
} else if (kwh >= 10) {
|
|
89
|
-
toFixed = 1;
|
|
90
|
-
}
|
|
91
|
-
return kwh.toFixed(toFixed);
|
|
92
|
-
},
|
|
93
|
-
color:props.theme?.global.secondFontColor,
|
|
94
|
-
},
|
|
95
|
-
nameTextStyle: {
|
|
96
|
-
fontSize: 14,
|
|
97
|
-
align:'left',
|
|
98
|
-
padding: [0, 0, 0, cx(-30)],
|
|
99
|
-
color: props.theme?.global.secondFontColor,
|
|
100
|
-
},
|
|
101
|
-
}, {
|
|
102
|
-
type: 'value',
|
|
103
|
-
name: I18n.formatValue('format_unit', unit),
|
|
104
|
-
position: 'right',
|
|
105
|
-
alignTicks: true,
|
|
106
|
-
max: Math.ceil(price ? maxValue * price * 1.4 : 0),
|
|
107
|
-
min: 0,
|
|
108
|
-
minInterval: 1,
|
|
109
|
-
axisLabel: {
|
|
110
|
-
formatter: function (value) {
|
|
111
|
-
const price=parseFloat(value);
|
|
112
|
-
let toFixed = 2;
|
|
113
|
-
if (price >= 100) {
|
|
114
|
-
toFixed = 0;
|
|
115
|
-
} else if (price >= 10) {
|
|
116
|
-
toFixed = 1;
|
|
117
|
-
}
|
|
118
|
-
return price.toFixed(toFixed);
|
|
119
|
-
},
|
|
120
|
-
color:props.theme?.global.secondFontColor,
|
|
121
|
-
},
|
|
122
|
-
nameTextStyle: {
|
|
123
|
-
fontSize: 14,
|
|
124
|
-
align:'right',
|
|
125
|
-
padding: [0, cx(-30), 0, 0],
|
|
126
|
-
color: props.theme?.global.secondFontColor,
|
|
127
|
-
},
|
|
128
|
-
}],
|
|
129
|
-
series: [
|
|
130
|
-
{
|
|
131
|
-
name: 'kWh',
|
|
132
|
-
type: 'bar',
|
|
133
|
-
data: dataKwhY,
|
|
134
|
-
itemStyle: {
|
|
135
|
-
emphasis: {
|
|
136
|
-
color: '#FFC2A9', // Color when bar is clicked
|
|
137
|
-
},
|
|
138
|
-
color: '#FFC2A9',
|
|
139
|
-
borderRadius: 2,
|
|
140
|
-
},
|
|
141
|
-
barMaxWidth: 10,
|
|
142
|
-
select: {
|
|
143
|
-
itemStyle: {
|
|
144
|
-
borderColor: '#FFC2A9',
|
|
145
|
-
}
|
|
146
|
-
},
|
|
147
|
-
selectedMode: 'single',
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
name: unit,
|
|
151
|
-
type: 'line',
|
|
152
|
-
data: dataPriceY,
|
|
153
|
-
yAxisIndex: 1,
|
|
154
|
-
smooth: true,
|
|
155
|
-
showSymbol: false,
|
|
156
|
-
color: '#F49431',
|
|
157
|
-
selectedMode: "single",
|
|
158
|
-
}
|
|
159
|
-
],
|
|
160
|
-
dataZoom: {
|
|
161
|
-
start: 0,
|
|
162
|
-
type: "inside",
|
|
163
|
-
maxValueSpan: 5,
|
|
164
|
-
zoomLock: true,
|
|
146
|
+
barMaxWidth: 10,
|
|
147
|
+
select: {
|
|
148
|
+
itemStyle: {
|
|
149
|
+
borderColor: '#FFC2A9',
|
|
150
|
+
}
|
|
165
151
|
},
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
}
|
|
152
|
+
selectedMode: 'single',
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
name: unit,
|
|
156
|
+
type: 'line',
|
|
157
|
+
data: dataPriceY,
|
|
158
|
+
yAxisIndex: 1,
|
|
159
|
+
smooth: true,
|
|
160
|
+
showSymbol: false,
|
|
161
|
+
color: '#F49431',
|
|
162
|
+
selectedMode: 'single',
|
|
163
|
+
}
|
|
164
|
+
],
|
|
165
|
+
dataZoom: {
|
|
166
|
+
start: 0,
|
|
167
|
+
type: 'inside',
|
|
168
|
+
zoomLock: true,
|
|
169
|
+
},
|
|
170
|
+
customMapData: {}
|
|
171
|
+
}
|
|
172
|
+
return (
|
|
173
|
+
<View style={{ flex: 1 }}>
|
|
174
|
+
<ECharts
|
|
175
|
+
option={option}
|
|
176
|
+
ref={echarts}
|
|
177
|
+
height={height}
|
|
178
|
+
/>
|
|
179
|
+
</View>
|
|
180
|
+
)
|
|
181
|
+
}
|
|
178
182
|
|
|
179
183
|
export default withTheme(BarChartWithTouch)
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import ThemeType from '@ledvance/base/src/config/themeType'
|
|
2
|
+
import I18n from '@ledvance/base/src/i18n'
|
|
3
|
+
import ECharts from '@ledvance/react-native-echarts-pro'
|
|
4
|
+
import React, { useRef } from 'react'
|
|
5
|
+
import { View } from 'react-native'
|
|
6
|
+
import { Utils } from 'tuya-panel-kit'
|
|
7
|
+
import { PowerDataItem } from '../EnergyConsumptionActions'
|
|
8
|
+
|
|
9
|
+
const { withTheme } = Utils.ThemeUtils
|
|
10
|
+
const cx = Utils.RatioUtils.convertX
|
|
11
|
+
|
|
12
|
+
interface PowerLineChartProps {
|
|
13
|
+
theme?: ThemeType
|
|
14
|
+
data: PowerDataItem[],
|
|
15
|
+
height: number
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const PowerLineChart = (props: PowerLineChartProps) => {
|
|
19
|
+
const echarts = useRef()
|
|
20
|
+
const { data, height } = props
|
|
21
|
+
|
|
22
|
+
const values = data?.map(item => ([item.time, item.value]))
|
|
23
|
+
|
|
24
|
+
const option = {
|
|
25
|
+
tooltip: {
|
|
26
|
+
show: true,
|
|
27
|
+
triggerOn: 'mousemove|click',
|
|
28
|
+
trigger: 'axis',
|
|
29
|
+
},
|
|
30
|
+
grid: {
|
|
31
|
+
right: 0
|
|
32
|
+
},
|
|
33
|
+
xAxis: {
|
|
34
|
+
type: 'time',
|
|
35
|
+
axisTick: {
|
|
36
|
+
show: false,
|
|
37
|
+
},
|
|
38
|
+
axisLabel: {
|
|
39
|
+
show: true,
|
|
40
|
+
color: props.theme?.global.secondFontColor,
|
|
41
|
+
interval: 'auto',
|
|
42
|
+
rotate: 45,
|
|
43
|
+
align: 'right',
|
|
44
|
+
verticalAlign: 'top'
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
yAxis: [{
|
|
48
|
+
type: 'value',
|
|
49
|
+
name: I18n.formatValue('format_unit', 'W'),
|
|
50
|
+
position: 'left',
|
|
51
|
+
axisLabel: {
|
|
52
|
+
formatter: function (value) {
|
|
53
|
+
const power = parseFloat(value)
|
|
54
|
+
let toFixed = 2
|
|
55
|
+
if (power >= 100) {
|
|
56
|
+
toFixed = 0
|
|
57
|
+
} else if (power >= 10) {
|
|
58
|
+
toFixed = 1
|
|
59
|
+
}
|
|
60
|
+
return power.toFixed(toFixed)
|
|
61
|
+
},
|
|
62
|
+
color: props.theme?.global.secondFontColor,
|
|
63
|
+
},
|
|
64
|
+
nameTextStyle: {
|
|
65
|
+
fontSize: 14,
|
|
66
|
+
align: 'left',
|
|
67
|
+
padding: [0, 0, 0, cx(-30)],
|
|
68
|
+
color: props.theme?.global.secondFontColor,
|
|
69
|
+
},
|
|
70
|
+
}],
|
|
71
|
+
series: [
|
|
72
|
+
{
|
|
73
|
+
name: I18n.getLang('consumption_data_field2_value_text1'),
|
|
74
|
+
type: 'line',
|
|
75
|
+
data: values,
|
|
76
|
+
areaStyle: {},
|
|
77
|
+
showSymbol: false,
|
|
78
|
+
color: '#F49431',
|
|
79
|
+
selectedMode: 'single',
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
dataZoom: {
|
|
83
|
+
start: 0,
|
|
84
|
+
type: 'inside',
|
|
85
|
+
zoomLock: false,
|
|
86
|
+
filterMode: 'none'
|
|
87
|
+
},
|
|
88
|
+
customMapData: {}
|
|
89
|
+
}
|
|
90
|
+
return (
|
|
91
|
+
<View style={{ flex: 1 }}>
|
|
92
|
+
<ECharts
|
|
93
|
+
option={option}
|
|
94
|
+
ref={echarts}
|
|
95
|
+
height={height}
|
|
96
|
+
/>
|
|
97
|
+
</View>
|
|
98
|
+
)
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export default withTheme(PowerLineChart)
|
|
Binary file
|
|
@@ -11,7 +11,7 @@ import { TimerPicker, Utils } from "tuya-panel-kit";
|
|
|
11
11
|
import DeleteButton from "@ledvance/base/src/components/DeleteButton";
|
|
12
12
|
import Spacer from "@ledvance/base/src/components/Spacer";
|
|
13
13
|
import { convertMinutesTo12HourFormat, loopText, showDialog } from "@ledvance/base/src/utils/common";
|
|
14
|
-
import LdvPickerView from "@ledvance/base/src/components/
|
|
14
|
+
import LdvPickerView from "@ledvance/base/src/components/LdvPickerView";
|
|
15
15
|
import LampAdjustView from '@ledvance/base/src/components/LampAdjustView'
|
|
16
16
|
import Card from "@ledvance/base/src/components/Card";
|
|
17
17
|
import LdvSwitch from "@ledvance/base/src/components/ldvSwitch";
|
|
@@ -7,7 +7,7 @@ import res from '@ledvance/base/src/res';
|
|
|
7
7
|
import { TimerPicker, Utils } from 'tuya-panel-kit';
|
|
8
8
|
import { useReactive, useUpdateEffect } from 'ahooks';
|
|
9
9
|
import TextField from '@ledvance/base/src/components/TextField';
|
|
10
|
-
import LdvPickerView from '@ledvance/base/src/components/
|
|
10
|
+
import LdvPickerView from '@ledvance/base/src/components/LdvPickerView';
|
|
11
11
|
import LdvWeekView from '@ledvance/base/src/components/weekSelect';
|
|
12
12
|
import {
|
|
13
13
|
convertMinutesTo12HourFormat,
|
|
@@ -4,7 +4,7 @@ import Page from "@ledvance/base/src/components/Page";
|
|
|
4
4
|
import { useDeviceInfo } from "@ledvance/base/src/models/modules/NativePropsSlice";
|
|
5
5
|
import { useNavigation } from '@react-navigation/native'
|
|
6
6
|
import { SwitchButton, Utils, Dialog } from "tuya-panel-kit";
|
|
7
|
-
import LdvPickerView from "@ledvance/base/src/components/
|
|
7
|
+
import LdvPickerView from "@ledvance/base/src/components/LdvPickerView";
|
|
8
8
|
import I18n from '@ledvance/base/src/i18n'
|
|
9
9
|
import { SwitchInchingItem, SwitchInchingPageParams, useSwitchInching, defSwitchInching, useCountdowns } from "./SwithInchingAction";
|
|
10
10
|
import { useParams } from "@ledvance/base/src/hooks/Hooks";
|
|
@@ -49,20 +49,20 @@ export const defOsramFanLightDeviceData = {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
export const getTimeSchedule = async (deviceId: string): Promise<Timer[]> => {
|
|
52
|
-
const res = await NativeApi.
|
|
53
|
-
if (res.
|
|
54
|
-
return res.
|
|
55
|
-
id: item?.
|
|
56
|
-
name: item?.
|
|
57
|
-
loops: item?.
|
|
58
|
-
time: item?.
|
|
59
|
-
dps: parseJSON(item?.
|
|
60
|
-
enable: !!Number(item?.
|
|
52
|
+
const res = await NativeApi.timerList(deviceId)
|
|
53
|
+
if (res.result && Array.isArray(res.value)) {
|
|
54
|
+
return res.value.map(item => ({
|
|
55
|
+
id: item?.id,
|
|
56
|
+
name: item?.aliasName,
|
|
57
|
+
loops: item?.loops,
|
|
58
|
+
time: item?.time,
|
|
59
|
+
dps: parseJSON(item?.dps),
|
|
60
|
+
enable: !!Number(item?.status),
|
|
61
61
|
notification: item?.isAppPush,
|
|
62
|
-
}))
|
|
62
|
+
}))
|
|
63
63
|
}
|
|
64
|
-
return []
|
|
65
|
-
}
|
|
64
|
+
return []
|
|
65
|
+
}
|
|
66
66
|
|
|
67
67
|
export const manageTimeSchedule = async (deviceId: string, schedule: Timer, mode: TimerActions) => {
|
|
68
68
|
const res = await NativeApi.manageTimer(
|
package/tsconfig.json
CHANGED
|
@@ -1,51 +1,78 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
/* Basic Options */
|
|
4
|
+
"target": "ES2017",
|
|
5
|
+
"lib": [
|
|
6
|
+
"es2017"
|
|
7
|
+
],
|
|
8
|
+
/* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
|
|
9
|
+
"module": "commonjs",
|
|
10
|
+
/* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
|
|
11
|
+
"jsx": "react",
|
|
12
|
+
/* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
|
|
10
13
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
/* Strict Type-Checking Options */
|
|
15
|
+
/* "strict": true /* Enable all strict type-checking options. */
|
|
16
|
+
"noImplicitAny": false,
|
|
17
|
+
/* Raise error on expressions and declarations with an implied 'any' type. */
|
|
18
|
+
"strictNullChecks": true,
|
|
19
|
+
/* Enable strict null checks. */
|
|
17
20
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
/* Additional Checks */
|
|
22
|
+
"noUnusedLocals": true,
|
|
23
|
+
/* Report errors on unused locals. */
|
|
24
|
+
"noUnusedParameters": true,
|
|
25
|
+
/* Report errors on unused parameters. */
|
|
23
26
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
27
|
+
/* .d.ts config */
|
|
28
|
+
"declaration": true,
|
|
29
|
+
"emitDeclarationOnly": true,
|
|
30
|
+
/* Module Resolution Options */
|
|
31
|
+
"moduleResolution": "node",
|
|
32
|
+
/* Specify module resolution strategy: 'node' (Node.js) or 'classic' */
|
|
33
|
+
"types": [
|
|
34
|
+
"react",
|
|
35
|
+
"react-native"
|
|
36
|
+
],
|
|
37
|
+
/* Type declaration files to be included in compilation. */
|
|
38
|
+
"typeRoots": [
|
|
39
|
+
"@types/*.d.ts"
|
|
40
|
+
],
|
|
41
|
+
"allowSyntheticDefaultImports": true,
|
|
42
|
+
/* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
|
|
43
|
+
"esModuleInterop": true,
|
|
44
|
+
/* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
|
|
45
|
+
"baseUrl": "./src",
|
|
46
|
+
"paths": {
|
|
47
|
+
"@api": [
|
|
48
|
+
"./api"
|
|
49
|
+
],
|
|
50
|
+
"@components": [
|
|
51
|
+
"./components"
|
|
52
|
+
],
|
|
53
|
+
"@config": [
|
|
54
|
+
"./config"
|
|
55
|
+
],
|
|
56
|
+
"@i18n": [
|
|
57
|
+
"./i18n"
|
|
58
|
+
],
|
|
59
|
+
"@models": [
|
|
60
|
+
"./models"
|
|
61
|
+
],
|
|
62
|
+
"@res": [
|
|
63
|
+
"./res"
|
|
64
|
+
],
|
|
65
|
+
"@utils": [
|
|
66
|
+
"./utils"
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"include": [
|
|
71
|
+
"src/**/*.ts",
|
|
72
|
+
"src/**/*.tsx"
|
|
73
|
+
],
|
|
74
|
+
"exclude": [
|
|
75
|
+
"node_modules",
|
|
76
|
+
".yalc"
|
|
77
|
+
]
|
|
51
78
|
}
|