@ledvance/base 1.0.25 → 1.0.27
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 +1 -0
- package/src/api/native.ts +17 -8
- package/src/components/ldvTopBar.d.ts +1 -1
- package/src/components/ldvTopBar.tsx +3 -2
- package/src/components/ldvTopName.d.ts +1 -1
- package/src/components/ldvTopName.tsx +3 -2
- package/src/i18n/strings.d.ts +1374 -2
- package/src/i18n/strings.ts +10052 -8680
package/package.json
CHANGED
package/src/api/native.d.ts
CHANGED
|
@@ -17,3 +17,4 @@ 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 queryDpIds: (dpIds: string, deviceId: string) => Promise<unknown>;
|
package/src/api/native.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {NativeModules} from 'react-native'
|
|
2
|
-
import {NativeResult, Result} from '../models/modules/Result'
|
|
1
|
+
import { NativeModules } from 'react-native'
|
|
2
|
+
import { NativeResult, Result } from '../models/modules/Result'
|
|
3
3
|
|
|
4
4
|
interface LDVDevicePanelManager {
|
|
5
5
|
back: () => void
|
|
@@ -11,6 +11,7 @@ interface LDVDevicePanelManager {
|
|
|
11
11
|
toDeviceSettingsPage: (deviceId: string) => void
|
|
12
12
|
putJson: (deviceId: string, featureType: string, json: string, callback: (res: NativeResult<any>) => void) => void
|
|
13
13
|
getJson: (deviceId: string, featureType: string, callback: (res: NativeResult<string>) => void) => void
|
|
14
|
+
getInitiativeQueryDpsInfoWithDpsArray: (dpIds: string, deviceId: string, callback: (res: NativeResult<string>) => void) => void
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
const devicePanel: LDVDevicePanelManager = NativeModules.LDVDevicePanelManager
|
|
@@ -31,7 +32,7 @@ const showObj = (objc) => {
|
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
const control = (devId, dps, callback) => {
|
|
34
|
-
devicePanel.control({devId, dps: JSON.stringify(dps)}, res => {
|
|
35
|
+
devicePanel.control({ devId, dps: JSON.stringify(dps) }, res => {
|
|
35
36
|
callback && callback(res)
|
|
36
37
|
})
|
|
37
38
|
}
|
|
@@ -41,7 +42,7 @@ const TASK = 'LDV_TY'
|
|
|
41
42
|
|
|
42
43
|
const timerList = devId => {
|
|
43
44
|
return new Promise((resolve, _reject) => {
|
|
44
|
-
const params = {devId, task: TASK, action: 'list', bizType: 0}
|
|
45
|
+
const params = { devId, task: TASK, action: 'list', bizType: 0 }
|
|
45
46
|
devicePanel.setTimer(params, res => {
|
|
46
47
|
resolve(res)
|
|
47
48
|
})
|
|
@@ -49,21 +50,21 @@ const timerList = devId => {
|
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
const addTimer = (devId, value, callback: any = undefined) => {
|
|
52
|
-
const params = {devId, task: TASK, action: 'add', value, bizType: 0}
|
|
53
|
+
const params = { devId, task: TASK, action: 'add', value, bizType: 0 }
|
|
53
54
|
devicePanel.setTimer(params, res => {
|
|
54
55
|
callback && callback(res)
|
|
55
56
|
})
|
|
56
57
|
}
|
|
57
58
|
|
|
58
59
|
const editTimer = (devId, value, callback: any = undefined) => {
|
|
59
|
-
const params = {devId, task: TASK, action: 'update', value, bizType: 0}
|
|
60
|
+
const params = { devId, task: TASK, action: 'update', value, bizType: 0 }
|
|
60
61
|
devicePanel.setTimer(params, res => {
|
|
61
62
|
callback && callback(res)
|
|
62
63
|
})
|
|
63
64
|
}
|
|
64
65
|
|
|
65
66
|
const deleteTimer = (devId, value, callback: any = undefined) => {
|
|
66
|
-
const params = {devId, task: TASK, action: 'delete', value, bizType: 0}
|
|
67
|
+
const params = { devId, task: TASK, action: 'delete', value, bizType: 0 }
|
|
67
68
|
devicePanel.setTimer(params, res => {
|
|
68
69
|
callback && callback(res)
|
|
69
70
|
})
|
|
@@ -81,7 +82,7 @@ function getAllTaskTimer(devId: string, type: number = 0, callback: ((res: Nativ
|
|
|
81
82
|
|
|
82
83
|
const setDp = <T>(deviceId: string, key: string, value: any) => {
|
|
83
84
|
return new Promise<NativeResult<T>>((resolve, _reject) => {
|
|
84
|
-
control(deviceId, {[key]: value}, res => {
|
|
85
|
+
control(deviceId, { [key]: value }, res => {
|
|
85
86
|
resolve(res)
|
|
86
87
|
})
|
|
87
88
|
})
|
|
@@ -207,4 +208,12 @@ export class NativeApi {
|
|
|
207
208
|
})
|
|
208
209
|
})
|
|
209
210
|
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export const queryDpIds = (dpIds: string, deviceId: string) => {
|
|
214
|
+
return new Promise((resolve, _reject) => {
|
|
215
|
+
devicePanel.getInitiativeQueryDpsInfoWithDpsArray(dpIds, deviceId, res => {
|
|
216
|
+
resolve(res)
|
|
217
|
+
})
|
|
218
|
+
})
|
|
210
219
|
}
|
|
@@ -2,7 +2,7 @@ interface TopBarProps {
|
|
|
2
2
|
title: string;
|
|
3
3
|
onBackPress: () => void;
|
|
4
4
|
rightButtonIcon?: any | {};
|
|
5
|
-
rightButtonStyle?: any | undefined;
|
|
5
|
+
rightButtonStyle?: any | undefined | number;
|
|
6
6
|
onRightButtonPress?: (() => void) | undefined;
|
|
7
7
|
}
|
|
8
8
|
declare const LDVTopBar: (props: TopBarProps) => JSX.Element;
|
|
@@ -10,11 +10,12 @@ interface TopBarProps {
|
|
|
10
10
|
title: string,
|
|
11
11
|
onBackPress: () => void,
|
|
12
12
|
rightButtonIcon?: any | {},
|
|
13
|
-
rightButtonStyle?: any | undefined,
|
|
13
|
+
rightButtonStyle?: any | undefined | number,
|
|
14
14
|
onRightButtonPress?: (() => void) | undefined,
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
const LDVTopBar = (props: TopBarProps) => {
|
|
18
|
+
const icon = typeof props.rightButtonIcon === 'number' ? props.rightButtonIcon : { uri: props.rightButtonIcon }
|
|
18
19
|
return (
|
|
19
20
|
<View
|
|
20
21
|
style={{
|
|
@@ -52,7 +53,7 @@ const LDVTopBar = (props: TopBarProps) => {
|
|
|
52
53
|
{ width: cx(28), height: cx(28) },
|
|
53
54
|
props.rightButtonStyle,
|
|
54
55
|
]}
|
|
55
|
-
source={
|
|
56
|
+
source={icon} />
|
|
56
57
|
</View>
|
|
57
58
|
</TouchableOpacity>
|
|
58
59
|
}
|
|
@@ -6,11 +6,12 @@ const cx = Utils.RatioUtils.convertX
|
|
|
6
6
|
|
|
7
7
|
interface LdvTopNameProps {
|
|
8
8
|
title: string,
|
|
9
|
-
rightIcon?: string | undefined,
|
|
9
|
+
rightIcon?: string | undefined | number,
|
|
10
10
|
rightIconClick?: () => void
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
const LdvTopName = (props: LdvTopNameProps) => {
|
|
14
|
+
const icon = typeof props.rightIcon === 'number' ? props.rightIcon : { uri: props.rightIcon }
|
|
14
15
|
return (
|
|
15
16
|
<View style={styles.container}>
|
|
16
17
|
<View
|
|
@@ -25,7 +26,7 @@ const LdvTopName = (props: LdvTopNameProps) => {
|
|
|
25
26
|
onPress={props.rightIconClick}>
|
|
26
27
|
<Image
|
|
27
28
|
style={{ width: cx(24), height: cx(24), tintColor: '#ff6600' }}
|
|
28
|
-
source={
|
|
29
|
+
source={icon} />
|
|
29
30
|
</TouchableOpacity>}
|
|
30
31
|
</View>
|
|
31
32
|
</View>
|