@ledvance/base 1.1.0 → 1.1.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/package.json +1 -1
- package/src/api/native.d.ts +3 -0
- package/src/components/ColorAdjustView.tsx +1 -0
- package/src/components/DeleteButton.d.ts +9 -0
- package/src/components/Page.d.ts +3 -1
- package/src/components/ldvPresetView.tsx +17 -20
- package/src/components/ldvTopName.d.ts +2 -0
- package/src/composeLayout.tsx +0 -2
- package/src/i18n/strings.d.ts +56 -0
- package/src/models/TuyaApi.d.ts +12 -0
- package/src/models/modules/NativePropsSlice.d.ts +17 -5
- package/src/models/modules/NativePropsSlice.tsx +2 -2
- package/src/models/modules/common.d.ts +21 -13
- package/src/utils/common.d.ts +2 -2
package/package.json
CHANGED
package/src/api/native.d.ts
CHANGED
|
@@ -17,4 +17,7 @@ export declare class NativeApi {
|
|
|
17
17
|
static putJson(deviceId: string, featureType: string, json: string): Promise<Result<any>>;
|
|
18
18
|
static getJson(deviceId: string, featureType: string): Promise<Result<string>>;
|
|
19
19
|
}
|
|
20
|
+
export declare const openDownloadFile: (filePath: string) => Promise<unknown>;
|
|
20
21
|
export declare const queryDpIds: (dpIds: string, deviceId: string) => Promise<unknown>;
|
|
22
|
+
export declare const formatNumber: (num: number, fixed: number) => string;
|
|
23
|
+
export declare const getTimeZone: () => string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { StyleProp, ViewStyle, TextStyle } from 'react-native';
|
|
2
|
+
interface DeleteButtonProps {
|
|
3
|
+
text: string;
|
|
4
|
+
onPress: () => void;
|
|
5
|
+
style?: StyleProp<ViewStyle>;
|
|
6
|
+
textStyle?: StyleProp<TextStyle>;
|
|
7
|
+
}
|
|
8
|
+
declare const DeleteButton: (props: DeleteButtonProps) => JSX.Element;
|
|
9
|
+
export default DeleteButton;
|
package/src/components/Page.d.ts
CHANGED
|
@@ -6,8 +6,10 @@ interface PageProps extends PropsWithChildren<ViewProps> {
|
|
|
6
6
|
rightButtonIcon?: string;
|
|
7
7
|
rightButtonIconClick?: () => void;
|
|
8
8
|
headlineText?: string;
|
|
9
|
-
headlineIcon?: string;
|
|
9
|
+
headlineIcon?: string | number;
|
|
10
10
|
onHeadlineIconClick?: () => void;
|
|
11
|
+
showGreenery?: boolean;
|
|
12
|
+
greeneryIcon?: string | undefined | number;
|
|
11
13
|
}
|
|
12
14
|
declare const Page: (props: PageProps) => JSX.Element;
|
|
13
15
|
export default Page;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import {
|
|
2
|
+
import {StyleSheet, TouchableOpacity, View} from 'react-native'
|
|
3
|
+
import {Utils} from 'tuya-panel-kit'
|
|
4
|
+
|
|
5
|
+
const {convertX: cx} = Utils.RatioUtils
|
|
3
6
|
|
|
4
7
|
const temperatures = [
|
|
5
8
|
{
|
|
@@ -50,22 +53,17 @@ const colors = [
|
|
|
50
53
|
]
|
|
51
54
|
|
|
52
55
|
const LdvPresetView = (props) => {
|
|
53
|
-
const {
|
|
56
|
+
const {type, onPress} = props
|
|
54
57
|
let dataSource = type == 'temperature' ? temperatures : colors
|
|
55
58
|
return (<View style={styles.container}>
|
|
56
|
-
{dataSource.map((item, index) =>
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
onPress
|
|
62
|
-
|
|
63
|
-
onPress(item)
|
|
64
|
-
}} />
|
|
65
|
-
)
|
|
66
|
-
})}
|
|
59
|
+
{dataSource.map((item, index) =>
|
|
60
|
+
<TouchableOpacity
|
|
61
|
+
key={index}
|
|
62
|
+
style={[styles.item, {backgroundColor: item.color}]}
|
|
63
|
+
onPress={() => {
|
|
64
|
+
onPress(item)
|
|
65
|
+
}}/>)}
|
|
67
66
|
</View>)
|
|
68
|
-
|
|
69
67
|
}
|
|
70
68
|
|
|
71
69
|
const styles = StyleSheet.create({
|
|
@@ -74,14 +72,13 @@ const styles = StyleSheet.create({
|
|
|
74
72
|
flexDirection: 'row',
|
|
75
73
|
justifyContent: 'space-between',
|
|
76
74
|
alignItems: 'center',
|
|
77
|
-
marginHorizontal: 16,
|
|
75
|
+
marginHorizontal: cx(16),
|
|
78
76
|
},
|
|
79
|
-
|
|
80
77
|
item: {
|
|
81
|
-
width: 28,
|
|
82
|
-
height: 28,
|
|
83
|
-
borderRadius: 14,
|
|
84
|
-
borderWidth: 1,
|
|
78
|
+
width: cx(28),
|
|
79
|
+
height: cx(28),
|
|
80
|
+
borderRadius: cx(14),
|
|
81
|
+
borderWidth: cx(1),
|
|
85
82
|
borderColor: 'rgb(230, 231, 232)',
|
|
86
83
|
},
|
|
87
84
|
})
|
|
@@ -2,6 +2,8 @@ interface LdvTopNameProps {
|
|
|
2
2
|
title: string;
|
|
3
3
|
rightIcon?: string | undefined | number;
|
|
4
4
|
rightIconClick?: () => void;
|
|
5
|
+
showGreenery?: boolean;
|
|
6
|
+
greeneryIcon?: string | undefined | number;
|
|
5
7
|
}
|
|
6
8
|
declare const LdvTopName: (props: LdvTopNameProps) => JSX.Element;
|
|
7
9
|
export default LdvTopName;
|
package/src/composeLayout.tsx
CHANGED
|
@@ -131,7 +131,6 @@ const composeLayout = (component: React.ComponentType) => {
|
|
|
131
131
|
pId: '',
|
|
132
132
|
},
|
|
133
133
|
familyName: ldvDevInfo.familyName,
|
|
134
|
-
timeSchedule: Symbol(),
|
|
135
134
|
}
|
|
136
135
|
NativeApi.showObj(nativeProps)
|
|
137
136
|
console.log('Redux 初始数据:', JSON.stringify(nativeProps))
|
|
@@ -155,7 +154,6 @@ const composeLayout = (component: React.ComponentType) => {
|
|
|
155
154
|
pId: uaGroupInfo.pId,
|
|
156
155
|
},
|
|
157
156
|
familyName: uaGroupInfo.familyName,
|
|
158
|
-
timeSchedule: Symbol(),
|
|
159
157
|
}
|
|
160
158
|
NativeApi.showObj(nativeProps)
|
|
161
159
|
console.log('Redux 初始数据:', JSON.stringify(nativeProps))
|
package/src/i18n/strings.d.ts
CHANGED
|
@@ -373,6 +373,8 @@ declare const _default: {
|
|
|
373
373
|
string_light_pp_field_sm_add_error1: string;
|
|
374
374
|
feature_activate_dialog_text: string;
|
|
375
375
|
edit_timeschedule_bttn_text: string;
|
|
376
|
+
edit_wakeupschedule_bttn_text: string;
|
|
377
|
+
edit_sleepschedule_bttn_text: string;
|
|
376
378
|
};
|
|
377
379
|
cs: {
|
|
378
380
|
add_new_dynamic_mood_color_changing_mode_value: string;
|
|
@@ -748,6 +750,8 @@ declare const _default: {
|
|
|
748
750
|
string_light_pp_field_sm_add_error1: string;
|
|
749
751
|
feature_activate_dialog_text: string;
|
|
750
752
|
edit_timeschedule_bttn_text: string;
|
|
753
|
+
edit_wakeupschedule_bttn_text: string;
|
|
754
|
+
edit_sleepschedule_bttn_text: string;
|
|
751
755
|
};
|
|
752
756
|
en: {
|
|
753
757
|
add_new_dynamic_mood_color_changing_mode_value: string;
|
|
@@ -1123,6 +1127,8 @@ declare const _default: {
|
|
|
1123
1127
|
string_light_pp_field_sm_add_error1: string;
|
|
1124
1128
|
feature_activate_dialog_text: string;
|
|
1125
1129
|
edit_timeschedule_bttn_text: string;
|
|
1130
|
+
edit_wakeupschedule_bttn_text: string;
|
|
1131
|
+
edit_sleepschedule_bttn_text: string;
|
|
1126
1132
|
};
|
|
1127
1133
|
bg: {
|
|
1128
1134
|
add_new_dynamic_mood_color_changing_mode_value: string;
|
|
@@ -1498,6 +1504,8 @@ declare const _default: {
|
|
|
1498
1504
|
string_light_pp_field_sm_add_error1: string;
|
|
1499
1505
|
feature_activate_dialog_text: string;
|
|
1500
1506
|
edit_timeschedule_bttn_text: string;
|
|
1507
|
+
edit_wakeupschedule_bttn_text: string;
|
|
1508
|
+
edit_sleepschedule_bttn_text: string;
|
|
1501
1509
|
};
|
|
1502
1510
|
da: {
|
|
1503
1511
|
add_new_dynamic_mood_color_changing_mode_value: string;
|
|
@@ -1873,6 +1881,8 @@ declare const _default: {
|
|
|
1873
1881
|
string_light_pp_field_sm_add_error1: string;
|
|
1874
1882
|
feature_activate_dialog_text: string;
|
|
1875
1883
|
edit_timeschedule_bttn_text: string;
|
|
1884
|
+
edit_wakeupschedule_bttn_text: string;
|
|
1885
|
+
edit_sleepschedule_bttn_text: string;
|
|
1876
1886
|
};
|
|
1877
1887
|
de: {
|
|
1878
1888
|
add_new_dynamic_mood_color_changing_mode_value: string;
|
|
@@ -2248,6 +2258,8 @@ declare const _default: {
|
|
|
2248
2258
|
string_light_pp_field_sm_add_error1: string;
|
|
2249
2259
|
feature_activate_dialog_text: string;
|
|
2250
2260
|
edit_timeschedule_bttn_text: string;
|
|
2261
|
+
edit_wakeupschedule_bttn_text: string;
|
|
2262
|
+
edit_sleepschedule_bttn_text: string;
|
|
2251
2263
|
};
|
|
2252
2264
|
el: {
|
|
2253
2265
|
add_new_dynamic_mood_color_changing_mode_value: string;
|
|
@@ -2623,6 +2635,8 @@ declare const _default: {
|
|
|
2623
2635
|
string_light_pp_field_sm_add_error1: string;
|
|
2624
2636
|
feature_activate_dialog_text: string;
|
|
2625
2637
|
edit_timeschedule_bttn_text: string;
|
|
2638
|
+
edit_wakeupschedule_bttn_text: string;
|
|
2639
|
+
edit_sleepschedule_bttn_text: string;
|
|
2626
2640
|
};
|
|
2627
2641
|
es: {
|
|
2628
2642
|
add_new_dynamic_mood_color_changing_mode_value: string;
|
|
@@ -2998,6 +3012,8 @@ declare const _default: {
|
|
|
2998
3012
|
string_light_pp_field_sm_add_error1: string;
|
|
2999
3013
|
feature_activate_dialog_text: string;
|
|
3000
3014
|
edit_timeschedule_bttn_text: string;
|
|
3015
|
+
edit_wakeupschedule_bttn_text: string;
|
|
3016
|
+
edit_sleepschedule_bttn_text: string;
|
|
3001
3017
|
};
|
|
3002
3018
|
et: {
|
|
3003
3019
|
add_new_dynamic_mood_color_changing_mode_value: string;
|
|
@@ -3373,6 +3389,8 @@ declare const _default: {
|
|
|
3373
3389
|
string_light_pp_field_sm_add_error1: string;
|
|
3374
3390
|
feature_activate_dialog_text: string;
|
|
3375
3391
|
edit_timeschedule_bttn_text: string;
|
|
3392
|
+
edit_wakeupschedule_bttn_text: string;
|
|
3393
|
+
edit_sleepschedule_bttn_text: string;
|
|
3376
3394
|
};
|
|
3377
3395
|
fi: {
|
|
3378
3396
|
add_new_dynamic_mood_color_changing_mode_value: string;
|
|
@@ -3748,6 +3766,8 @@ declare const _default: {
|
|
|
3748
3766
|
string_light_pp_field_sm_add_error1: string;
|
|
3749
3767
|
feature_activate_dialog_text: string;
|
|
3750
3768
|
edit_timeschedule_bttn_text: string;
|
|
3769
|
+
edit_wakeupschedule_bttn_text: string;
|
|
3770
|
+
edit_sleepschedule_bttn_text: string;
|
|
3751
3771
|
};
|
|
3752
3772
|
fr: {
|
|
3753
3773
|
add_new_dynamic_mood_color_changing_mode_value: string;
|
|
@@ -4123,6 +4143,8 @@ declare const _default: {
|
|
|
4123
4143
|
string_light_pp_field_sm_add_error1: string;
|
|
4124
4144
|
feature_activate_dialog_text: string;
|
|
4125
4145
|
edit_timeschedule_bttn_text: string;
|
|
4146
|
+
edit_wakeupschedule_bttn_text: string;
|
|
4147
|
+
edit_sleepschedule_bttn_text: string;
|
|
4126
4148
|
};
|
|
4127
4149
|
hr: {
|
|
4128
4150
|
add_new_dynamic_mood_color_changing_mode_value: string;
|
|
@@ -4498,6 +4520,8 @@ declare const _default: {
|
|
|
4498
4520
|
string_light_pp_field_sm_add_error1: string;
|
|
4499
4521
|
feature_activate_dialog_text: string;
|
|
4500
4522
|
edit_timeschedule_bttn_text: string;
|
|
4523
|
+
edit_wakeupschedule_bttn_text: string;
|
|
4524
|
+
edit_sleepschedule_bttn_text: string;
|
|
4501
4525
|
};
|
|
4502
4526
|
hu: {
|
|
4503
4527
|
add_new_dynamic_mood_color_changing_mode_value: string;
|
|
@@ -4873,6 +4897,8 @@ declare const _default: {
|
|
|
4873
4897
|
string_light_pp_field_sm_add_error1: string;
|
|
4874
4898
|
feature_activate_dialog_text: string;
|
|
4875
4899
|
edit_timeschedule_bttn_text: string;
|
|
4900
|
+
edit_wakeupschedule_bttn_text: string;
|
|
4901
|
+
edit_sleepschedule_bttn_text: string;
|
|
4876
4902
|
};
|
|
4877
4903
|
it: {
|
|
4878
4904
|
add_new_dynamic_mood_color_changing_mode_value: string;
|
|
@@ -5248,6 +5274,8 @@ declare const _default: {
|
|
|
5248
5274
|
string_light_pp_field_sm_add_error1: string;
|
|
5249
5275
|
feature_activate_dialog_text: string;
|
|
5250
5276
|
edit_timeschedule_bttn_text: string;
|
|
5277
|
+
edit_wakeupschedule_bttn_text: string;
|
|
5278
|
+
edit_sleepschedule_bttn_text: string;
|
|
5251
5279
|
};
|
|
5252
5280
|
ko: {
|
|
5253
5281
|
add_new_dynamic_mood_color_changing_mode_value: string;
|
|
@@ -5623,6 +5651,8 @@ declare const _default: {
|
|
|
5623
5651
|
string_light_pp_field_sm_add_error1: string;
|
|
5624
5652
|
feature_activate_dialog_text: string;
|
|
5625
5653
|
edit_timeschedule_bttn_text: string;
|
|
5654
|
+
edit_wakeupschedule_bttn_text: string;
|
|
5655
|
+
edit_sleepschedule_bttn_text: string;
|
|
5626
5656
|
};
|
|
5627
5657
|
lt: {
|
|
5628
5658
|
add_new_dynamic_mood_color_changing_mode_value: string;
|
|
@@ -5998,6 +6028,8 @@ declare const _default: {
|
|
|
5998
6028
|
string_light_pp_field_sm_add_error1: string;
|
|
5999
6029
|
feature_activate_dialog_text: string;
|
|
6000
6030
|
edit_timeschedule_bttn_text: string;
|
|
6031
|
+
edit_wakeupschedule_bttn_text: string;
|
|
6032
|
+
edit_sleepschedule_bttn_text: string;
|
|
6001
6033
|
};
|
|
6002
6034
|
lv: {
|
|
6003
6035
|
add_new_dynamic_mood_color_changing_mode_value: string;
|
|
@@ -6373,6 +6405,8 @@ declare const _default: {
|
|
|
6373
6405
|
string_light_pp_field_sm_add_error1: string;
|
|
6374
6406
|
feature_activate_dialog_text: string;
|
|
6375
6407
|
edit_timeschedule_bttn_text: string;
|
|
6408
|
+
edit_wakeupschedule_bttn_text: string;
|
|
6409
|
+
edit_sleepschedule_bttn_text: string;
|
|
6376
6410
|
};
|
|
6377
6411
|
nb: {
|
|
6378
6412
|
add_new_dynamic_mood_color_changing_mode_value: string;
|
|
@@ -6748,6 +6782,8 @@ declare const _default: {
|
|
|
6748
6782
|
string_light_pp_field_sm_add_error1: string;
|
|
6749
6783
|
feature_activate_dialog_text: string;
|
|
6750
6784
|
edit_timeschedule_bttn_text: string;
|
|
6785
|
+
edit_wakeupschedule_bttn_text: string;
|
|
6786
|
+
edit_sleepschedule_bttn_text: string;
|
|
6751
6787
|
};
|
|
6752
6788
|
nl: {
|
|
6753
6789
|
add_new_dynamic_mood_color_changing_mode_value: string;
|
|
@@ -7123,6 +7159,8 @@ declare const _default: {
|
|
|
7123
7159
|
string_light_pp_field_sm_add_error1: string;
|
|
7124
7160
|
feature_activate_dialog_text: string;
|
|
7125
7161
|
edit_timeschedule_bttn_text: string;
|
|
7162
|
+
edit_wakeupschedule_bttn_text: string;
|
|
7163
|
+
edit_sleepschedule_bttn_text: string;
|
|
7126
7164
|
};
|
|
7127
7165
|
pl: {
|
|
7128
7166
|
add_new_dynamic_mood_color_changing_mode_value: string;
|
|
@@ -7498,6 +7536,8 @@ declare const _default: {
|
|
|
7498
7536
|
string_light_pp_field_sm_add_error1: string;
|
|
7499
7537
|
feature_activate_dialog_text: string;
|
|
7500
7538
|
edit_timeschedule_bttn_text: string;
|
|
7539
|
+
edit_wakeupschedule_bttn_text: string;
|
|
7540
|
+
edit_sleepschedule_bttn_text: string;
|
|
7501
7541
|
};
|
|
7502
7542
|
'pt-BR': {
|
|
7503
7543
|
add_new_dynamic_mood_color_changing_mode_value: string;
|
|
@@ -7873,6 +7913,8 @@ declare const _default: {
|
|
|
7873
7913
|
string_light_pp_field_sm_add_error1: string;
|
|
7874
7914
|
feature_activate_dialog_text: string;
|
|
7875
7915
|
edit_timeschedule_bttn_text: string;
|
|
7916
|
+
edit_wakeupschedule_bttn_text: string;
|
|
7917
|
+
edit_sleepschedule_bttn_text: string;
|
|
7876
7918
|
};
|
|
7877
7919
|
pt_BR: {
|
|
7878
7920
|
add_new_dynamic_mood_color_changing_mode_value: string;
|
|
@@ -8248,6 +8290,8 @@ declare const _default: {
|
|
|
8248
8290
|
string_light_pp_field_sm_add_error1: string;
|
|
8249
8291
|
feature_activate_dialog_text: string;
|
|
8250
8292
|
edit_timeschedule_bttn_text: string;
|
|
8293
|
+
edit_wakeupschedule_bttn_text: string;
|
|
8294
|
+
edit_sleepschedule_bttn_text: string;
|
|
8251
8295
|
};
|
|
8252
8296
|
ro: {
|
|
8253
8297
|
add_new_dynamic_mood_color_changing_mode_value: string;
|
|
@@ -8623,6 +8667,8 @@ declare const _default: {
|
|
|
8623
8667
|
string_light_pp_field_sm_add_error1: string;
|
|
8624
8668
|
feature_activate_dialog_text: string;
|
|
8625
8669
|
edit_timeschedule_bttn_text: string;
|
|
8670
|
+
edit_wakeupschedule_bttn_text: string;
|
|
8671
|
+
edit_sleepschedule_bttn_text: string;
|
|
8626
8672
|
};
|
|
8627
8673
|
ru: {
|
|
8628
8674
|
add_new_dynamic_mood_color_changing_mode_value: string;
|
|
@@ -8998,6 +9044,8 @@ declare const _default: {
|
|
|
8998
9044
|
string_light_pp_field_sm_add_error1: string;
|
|
8999
9045
|
feature_activate_dialog_text: string;
|
|
9000
9046
|
edit_timeschedule_bttn_text: string;
|
|
9047
|
+
edit_wakeupschedule_bttn_text: string;
|
|
9048
|
+
edit_sleepschedule_bttn_text: string;
|
|
9001
9049
|
};
|
|
9002
9050
|
sk: {
|
|
9003
9051
|
add_new_dynamic_mood_color_changing_mode_value: string;
|
|
@@ -9373,6 +9421,8 @@ declare const _default: {
|
|
|
9373
9421
|
string_light_pp_field_sm_add_error1: string;
|
|
9374
9422
|
feature_activate_dialog_text: string;
|
|
9375
9423
|
edit_timeschedule_bttn_text: string;
|
|
9424
|
+
edit_wakeupschedule_bttn_text: string;
|
|
9425
|
+
edit_sleepschedule_bttn_text: string;
|
|
9376
9426
|
};
|
|
9377
9427
|
sv: {
|
|
9378
9428
|
add_new_dynamic_mood_color_changing_mode_value: string;
|
|
@@ -9748,6 +9798,8 @@ declare const _default: {
|
|
|
9748
9798
|
string_light_pp_field_sm_add_error1: string;
|
|
9749
9799
|
feature_activate_dialog_text: string;
|
|
9750
9800
|
edit_timeschedule_bttn_text: string;
|
|
9801
|
+
edit_wakeupschedule_bttn_text: string;
|
|
9802
|
+
edit_sleepschedule_bttn_text: string;
|
|
9751
9803
|
};
|
|
9752
9804
|
tr: {
|
|
9753
9805
|
add_new_dynamic_mood_color_changing_mode_value: string;
|
|
@@ -10123,6 +10175,8 @@ declare const _default: {
|
|
|
10123
10175
|
string_light_pp_field_sm_add_error1: string;
|
|
10124
10176
|
feature_activate_dialog_text: string;
|
|
10125
10177
|
edit_timeschedule_bttn_text: string;
|
|
10178
|
+
edit_wakeupschedule_bttn_text: string;
|
|
10179
|
+
edit_sleepschedule_bttn_text: string;
|
|
10126
10180
|
};
|
|
10127
10181
|
uk: {
|
|
10128
10182
|
add_new_dynamic_mood_color_changing_mode_value: string;
|
|
@@ -10498,6 +10552,8 @@ declare const _default: {
|
|
|
10498
10552
|
string_light_pp_field_sm_add_error1: string;
|
|
10499
10553
|
feature_activate_dialog_text: string;
|
|
10500
10554
|
edit_timeschedule_bttn_text: string;
|
|
10555
|
+
edit_wakeupschedule_bttn_text: string;
|
|
10556
|
+
edit_sleepschedule_bttn_text: string;
|
|
10501
10557
|
};
|
|
10502
10558
|
};
|
|
10503
10559
|
export default _default;
|
package/src/models/TuyaApi.d.ts
CHANGED
|
@@ -15,3 +15,15 @@ export interface DpReportSataData {
|
|
|
15
15
|
value: string;
|
|
16
16
|
}
|
|
17
17
|
export declare function getDpReportSataData(deviceId: string, dpIds: string[], offset: number, limit: number, sortType?: 'ASC' | 'DESC'): Promise<DpReportSataResData>;
|
|
18
|
+
export interface DpResultByMonthResData {
|
|
19
|
+
years: object;
|
|
20
|
+
thisDay: string;
|
|
21
|
+
sum: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function getDpResultByMonth(devId: string, dpId: string, type: "sum" | "minux" | "mac"): Promise<DpResultByMonthResData>;
|
|
24
|
+
export interface DpResultByDataWithSpecifiedResData {
|
|
25
|
+
result: object;
|
|
26
|
+
min: string;
|
|
27
|
+
}
|
|
28
|
+
export declare function getDataWithSpecified(devId: string, dpId: string, startDay: string, endDay: string, type: "sum" | "minux" | "avg"): Promise<DpResultByDataWithSpecifiedResData>;
|
|
29
|
+
export declare function getDpResultByHour(devId: string, dpId: string, date: string, type: "sum" | "minux" | "avg"): Promise<DpResultByDataWithSpecifiedResData>;
|
|
@@ -2,11 +2,21 @@ import { Dispatch } from 'react';
|
|
|
2
2
|
import { Result } from './Result';
|
|
3
3
|
import { DevInfo, DpValue } from 'tuya-panel-kit';
|
|
4
4
|
export interface NativeProps {
|
|
5
|
+
familyName: string;
|
|
6
|
+
deviceInfo: DeviceInfo;
|
|
7
|
+
uaGroupInfo: UAGroupInfo;
|
|
8
|
+
timeSchedule?: symbol;
|
|
9
|
+
energieverbrauch?: object;
|
|
10
|
+
}
|
|
11
|
+
export interface DeviceInfo {
|
|
5
12
|
devId: string;
|
|
6
13
|
pId: string;
|
|
7
14
|
dps: any;
|
|
8
|
-
|
|
9
|
-
|
|
15
|
+
}
|
|
16
|
+
export interface UAGroupInfo {
|
|
17
|
+
tyGroupId: number;
|
|
18
|
+
pId: string;
|
|
19
|
+
dps: any;
|
|
10
20
|
}
|
|
11
21
|
declare function simpleSetDps<T>(dispatch: Dispatch<any>): (deviceId: string, dps: any) => Promise<Result<T>>;
|
|
12
22
|
declare function simpleSetDp<T>(dispatch: Dispatch<any>): (deviceId: string, dp: string, value: any) => Promise<Result<T>>;
|
|
@@ -19,7 +29,9 @@ interface DpState {
|
|
|
19
29
|
[dpCode: string]: DpValue;
|
|
20
30
|
}
|
|
21
31
|
declare const useDeviceInfo: () => DevInfo<DpState>;
|
|
22
|
-
declare const useTimeSchedule: () => [v:
|
|
32
|
+
declare const useTimeSchedule: () => [v: symbol | undefined, f: any];
|
|
33
|
+
declare const useEnergieverbrauch: () => (object | undefined)[];
|
|
34
|
+
export declare const useEngergyGeneration: () => boolean;
|
|
23
35
|
export declare const ldvModules: import("@reduxjs/toolkit").Reducer<NativeProps, import("@reduxjs/toolkit").AnyAction>;
|
|
24
|
-
export declare const setNativeProps: import("@reduxjs/toolkit").ActionCreatorWithPayload<NativeProps, string>, setDps: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, string>, setTimeSchedule: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, string>;
|
|
25
|
-
export { simpleSetDps, simpleSetDp, useDeviceId, useDeviceInfo, useDp, useDps, useFamilyName, useTimeSchedule, };
|
|
36
|
+
export declare const setNativeProps: import("@reduxjs/toolkit").ActionCreatorWithPayload<NativeProps, string>, setGroupNativeProps: import("@reduxjs/toolkit").ActionCreatorWithPayload<NativeProps, string>, setDps: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, string>, setTimeSchedule: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, string>, setEnergieverbrauch: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, string>;
|
|
37
|
+
export { simpleSetDps, simpleSetDp, useDeviceId, useDeviceInfo, useDp, useDps, useFamilyName, useTimeSchedule, useEnergieverbrauch, };
|
|
@@ -10,7 +10,7 @@ export interface NativeProps {
|
|
|
10
10
|
familyName: string
|
|
11
11
|
deviceInfo: DeviceInfo
|
|
12
12
|
uaGroupInfo: UAGroupInfo
|
|
13
|
-
timeSchedule
|
|
13
|
+
timeSchedule?: symbol
|
|
14
14
|
energieverbrauch?: object
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -163,7 +163,7 @@ const useDeviceInfo: () => DevInfo<DpState> = () => {
|
|
|
163
163
|
return useSelector(state => state.devInfo)
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
-
const useTimeSchedule = (): [v:
|
|
166
|
+
const useTimeSchedule = (): [v: symbol | undefined, f: any] => {
|
|
167
167
|
const dps = useSelector(store => store.ldvModules.timeSchedule)
|
|
168
168
|
const dispatch = useDispatch()
|
|
169
169
|
const setTimeScheduleFn = (value: Symbol) => {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { DpValue } from 'tuya-panel-kit';
|
|
1
|
+
import { DevInfo, DpValue } from 'tuya-panel-kit';
|
|
2
|
+
import { Observable } from 'rxjs/Observable';
|
|
3
|
+
import { ActionsObservable } from 'redux-observable';
|
|
2
4
|
import 'rxjs/add/observable/fromPromise';
|
|
3
5
|
import 'rxjs/add/observable/of';
|
|
4
6
|
import 'rxjs/add/observable/merge';
|
|
@@ -16,21 +18,27 @@ export interface Log {
|
|
|
16
18
|
time: string;
|
|
17
19
|
isSend: boolean;
|
|
18
20
|
}
|
|
21
|
+
declare type Logs = Array<Log>;
|
|
22
|
+
declare type UpdateDevInfoPayload = DevInfo;
|
|
23
|
+
declare type UpdateDpStatePayload = Partial<DpState> & {
|
|
24
|
+
[key: string]: DpValue;
|
|
25
|
+
};
|
|
19
26
|
export declare const actions: {
|
|
20
|
-
devInfoChange:
|
|
21
|
-
deviceChange:
|
|
22
|
-
responseUpdateDp:
|
|
23
|
-
updateDp:
|
|
24
|
-
consoleChange: any
|
|
25
|
-
clearConsole: any
|
|
27
|
+
devInfoChange: import("redux-actions").ActionFunction1<UpdateDevInfoPayload, import("redux-actions").Action<UpdateDevInfoPayload>>;
|
|
28
|
+
deviceChange: import("redux-actions").ActionFunction1<UpdateDevInfoPayload, import("redux-actions").Action<UpdateDevInfoPayload>>;
|
|
29
|
+
responseUpdateDp: import("redux-actions").ActionFunction1<UpdateDpStatePayload, import("redux-actions").Action<UpdateDpStatePayload>>;
|
|
30
|
+
updateDp: import("redux-actions").ActionFunction1<UpdateDpStatePayload, import("redux-actions").Action<UpdateDpStatePayload>>;
|
|
31
|
+
consoleChange: import("redux-actions").ActionFunctionAny<import("redux-actions").Action<any>>;
|
|
32
|
+
clearConsole: import("redux-actions").ActionFunctionAny<import("redux-actions").Action<any>>;
|
|
26
33
|
};
|
|
27
|
-
export type Actions = {
|
|
34
|
+
export declare type Actions = {
|
|
28
35
|
[K in keyof typeof actions]: ReturnType<typeof actions[K]>;
|
|
29
36
|
};
|
|
30
37
|
export declare const reducers: {
|
|
31
|
-
dpState:
|
|
32
|
-
devInfo:
|
|
33
|
-
logs:
|
|
34
|
-
ldvModules:
|
|
38
|
+
dpState: import("redux-actions").ReduxCompatibleReducer<DpState, UpdateDevInfoPayload | UpdateDpStatePayload>;
|
|
39
|
+
devInfo: import("redux-actions").ReduxCompatibleReducer<DevInfo<DpState>, DevInfo<DpState>>;
|
|
40
|
+
logs: import("redux-actions").ReduxCompatibleReducer<Logs, DevInfo<Record<string, import("tuya-panel-kit").DpType>> | UpdateDpStatePayload | undefined>;
|
|
41
|
+
ldvModules: import("@reduxjs/toolkit").Reducer<import("./NativePropsSlice").NativeProps, import("@reduxjs/toolkit").AnyAction>;
|
|
35
42
|
};
|
|
36
|
-
export declare const epics: ((action$: ActionsObservable<
|
|
43
|
+
export declare const epics: ((action$: ActionsObservable<Actions['updateDp']>) => Observable<import("redux-actions").Action<UpdateDpStatePayload>>)[];
|
|
44
|
+
export {};
|
package/src/utils/common.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export declare function getWeek(weekString: any): number[];
|
|
|
11
11
|
*/
|
|
12
12
|
export declare function spliceByStep(str: string, step: number): string[];
|
|
13
13
|
export declare function hex2Int(hex: string): number;
|
|
14
|
-
export declare const localeNumber: (v: number | string, fixed?: number) => string | number;
|
|
14
|
+
export declare const localeNumber: (v: number | string, fixed?: number | undefined) => string | number;
|
|
15
15
|
export declare const exportFile: (list: any) => void;
|
|
16
16
|
export declare const exportHistoryFile: (list: any) => void;
|
|
17
17
|
export declare const monthFormat: (v: number | string) => string;
|
|
@@ -30,5 +30,5 @@ interface DialogProps {
|
|
|
30
30
|
close: () => void;
|
|
31
31
|
}) => void;
|
|
32
32
|
}
|
|
33
|
-
export declare function showDialog(props: DialogProps):
|
|
33
|
+
export declare function showDialog(props: DialogProps): void;
|
|
34
34
|
export {};
|