@ledvance/base 1.1.48 → 1.1.50
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.
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
@ColumnInfo(name = "device_id")
|
|
2
|
+
val deviceId: String,
|
|
3
|
+
@ColumnInfo(name = "device_name")
|
|
4
|
+
val deviceName: String,
|
|
5
|
+
@ColumnInfo(name = "cat_id")
|
|
6
|
+
val catId: String,
|
|
7
|
+
@ColumnInfo(name = "channel_no")
|
|
8
|
+
val channelNo: Int,
|
|
9
|
+
@ColumnInfo(name = "device_category")
|
|
10
|
+
val deviceCategory: String,
|
|
11
|
+
@ColumnInfo(name = "device_image")
|
|
12
|
+
val deviceImage: String,
|
|
13
|
+
@ColumnInfo(name = "tuya_device_id")
|
|
14
|
+
val tuyaDeviceId: String,
|
|
15
|
+
// deviceType 对应 ProductInfo 的 productId
|
|
16
|
+
@ColumnInfo(name = "device_type")
|
|
17
|
+
val deviceType: String,
|
|
18
|
+
@ColumnInfo(name = "offline_time")
|
|
19
|
+
val offlineTime: String,
|
|
20
|
+
@ColumnInfo(name = "rn_package")
|
|
21
|
+
val rnPackage: String?,
|
|
22
|
+
@ColumnInfo(name = "status")
|
|
23
|
+
val status: Int,
|
|
24
|
+
@ColumnInfo(name = "create_time")
|
|
25
|
+
val createTime: String,
|
|
26
|
+
@ColumnInfo(name = "version")
|
|
27
|
+
val version: String,
|
|
28
|
+
@ColumnInfo(name = "user_id")
|
|
29
|
+
val userId: String,
|
|
30
|
+
@ColumnInfo(name = "family_id")
|
|
31
|
+
val familyId: Long,
|
|
32
|
+
@ColumnInfo(name = "room_id")
|
|
33
|
+
val roomId: Long,
|
|
34
|
+
@ColumnInfo(name = "room_name")
|
|
35
|
+
val roomName: String,
|
|
36
|
+
@ColumnInfo(name = "is_shared")
|
|
37
|
+
val isShared: Int,
|
|
38
|
+
@ColumnInfo(name = "local_index")
|
|
39
|
+
val localIndex: String,
|
|
40
|
+
@ColumnInfo(name = "resource_category")
|
|
41
|
+
val resourceCategory: String,
|
|
42
|
+
@ColumnInfo(name = "resource_id")
|
|
43
|
+
val resourceId: String,
|
|
44
|
+
@ColumnInfo(name = "resource_identifier")
|
|
45
|
+
val resourceIdentifier: String,
|
|
46
|
+
@ColumnInfo(name = "resource_type")
|
|
47
|
+
val resourceType: Int,
|
|
48
|
+
@ColumnInfo(name = "index")
|
|
49
|
+
val index: Int = 0,
|
|
50
|
+
@ColumnInfo(name = "switch_state")
|
|
51
|
+
val switchState: Boolean = true
|
package/package.json
CHANGED
package/src/api/native.d.ts
CHANGED
|
@@ -59,7 +59,7 @@ export declare class NativeApi {
|
|
|
59
59
|
}
|
|
60
60
|
export declare const openDownloadFile: (filePath: string) => Promise<unknown>;
|
|
61
61
|
export declare const queryDpIds: (dpIds: string, deviceId: string) => Promise<unknown>;
|
|
62
|
-
export declare const formatNumber: (num: number, fixed: number,
|
|
62
|
+
export declare const formatNumber: (num: number, fixed: number, shoGroup?: boolean) => string;
|
|
63
63
|
export declare const getTimeZone: () => string;
|
|
64
64
|
export declare const getSystemTimeFormat: () => Promise<number>;
|
|
65
65
|
export {};
|
package/src/api/native.ts
CHANGED
|
@@ -8,7 +8,7 @@ interface LDVDevicePanelManager {
|
|
|
8
8
|
getAllTaskTimer: (deviceId: string, type: number, callback: (res: NativeResult<string>) => void) => void
|
|
9
9
|
deleteDevice: (deviceId: string, isReset: boolean, callback: (result: any) => void) => void
|
|
10
10
|
rename: (deviceId: string, name: string, callback: (result: any) => void) => void
|
|
11
|
-
toDeviceSettingsPage: (deviceId: string) => void
|
|
11
|
+
toDeviceSettingsPage: (deviceId: string, isGroup: boolean) => 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
14
|
getInitiativeQueryDpsInfoWithDpsArray: (dpIds: string, deviceId: string, callback: (res: NativeResult<string>) => void) => void
|
|
@@ -192,8 +192,8 @@ const rename: RenameResultType = (deviceId: string, name: string) => {
|
|
|
192
192
|
})
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
-
function toDeviceSettingsPage(tuyaDeviceId: string) {
|
|
196
|
-
devicePanel.toDeviceSettingsPage(tuyaDeviceId)
|
|
195
|
+
function toDeviceSettingsPage(tuyaDeviceId: string, isGroup: boolean = false) {
|
|
196
|
+
devicePanel.toDeviceSettingsPage(tuyaDeviceId, isGroup)
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
export class NativeApi {
|
|
@@ -319,8 +319,8 @@ export const queryDpIds = (dpIds: string, deviceId: string) => {
|
|
|
319
319
|
})
|
|
320
320
|
}
|
|
321
321
|
|
|
322
|
-
export const formatNumber: (num: number, fixed: number,
|
|
323
|
-
const res = devicePanel.formatNumber(num, fixed,
|
|
322
|
+
export const formatNumber: (num: number, fixed: number, shoGroup?: boolean) => string = (num, fixed, shoGroup: boolean = true) => {
|
|
323
|
+
const res = devicePanel.formatNumber(num, fixed, shoGroup)
|
|
324
324
|
log(`formatNumber: num=${num}, fixed=${fixed}, res=${res}`)
|
|
325
325
|
return res
|
|
326
326
|
}
|
|
@@ -186,7 +186,7 @@ const useDeviceInfo: () => DevInfo<DpState> = () => {
|
|
|
186
186
|
const useTimeSchedule = (): [v: boolean | undefined, f: any] => {
|
|
187
187
|
const dps = useSelector(store => store.ldvModules.timeSchedule)
|
|
188
188
|
const dispatch = useDispatch()
|
|
189
|
-
const setTimeScheduleFn = (value:
|
|
189
|
+
const setTimeScheduleFn = (value: boolean) => {
|
|
190
190
|
dispatch(setTimeSchedule(value))
|
|
191
191
|
}
|
|
192
192
|
return [dps, setTimeScheduleFn]
|
package/src/utils/common.d.ts
CHANGED
|
@@ -11,7 +11,8 @@ 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 | undefined) => string | number;
|
|
14
|
+
export declare const localeNumber: (v: number | string, fixed?: number | undefined, showGroup?: boolean | undefined) => string | number;
|
|
15
|
+
export declare const exchangeNumber: (v: number | string) => string;
|
|
15
16
|
export declare const exportFile: (list: any) => void;
|
|
16
17
|
export declare const exportHistoryFile: (list: any) => void;
|
|
17
18
|
export declare const monthFormat: (v: number | string) => string;
|
package/src/utils/common.ts
CHANGED
|
@@ -86,19 +86,21 @@ if (Platform.OS === 'ios') {
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
// 德国数字格式化
|
|
89
|
-
export const localeNumber = (v: number | string, fixed?: number) => {
|
|
89
|
+
export const localeNumber = (v: number | string, fixed?: number, showGroup?: boolean) => {
|
|
90
90
|
const mFixed = fixed || 2
|
|
91
91
|
const n = isNaN(Number(v)) ? 0 : Number(v)
|
|
92
|
-
const num = Number(n.toFixed(mFixed))
|
|
93
92
|
try {
|
|
94
|
-
if (Platform.OS === 'android') return formatNumber(n, mFixed)
|
|
93
|
+
if (Platform.OS === 'android') return formatNumber(n, mFixed, showGroup)
|
|
95
94
|
let local = defaultLocale
|
|
96
95
|
if (defaultLocale !== 'pt_BR' && defaultLocale !== 'pt-BR') {
|
|
97
96
|
local = defaultLocale.split('_')[0]
|
|
98
97
|
}
|
|
99
|
-
return new Intl.NumberFormat(local
|
|
98
|
+
return new Intl.NumberFormat(local, {
|
|
99
|
+
useGrouping: showGroup !== undefined ? showGroup : true,
|
|
100
|
+
maximumFractionDigits: mFixed
|
|
101
|
+
}).format(n)
|
|
100
102
|
} catch (_) {
|
|
101
|
-
return
|
|
103
|
+
return n
|
|
102
104
|
}
|
|
103
105
|
}
|
|
104
106
|
|