@ledvance/base 1.1.88 → 1.1.89

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 CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "@ledvance/base",
5
5
  "pid": [],
6
6
  "uiid": "",
7
- "version": "1.1.88",
7
+ "version": "1.1.89",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
10
  "@reduxjs/toolkit": "^1.8.6",
package/src/api/native.ts CHANGED
@@ -21,6 +21,7 @@ interface LDVDevicePanelManager {
21
21
  putFeature: (deviceId: string, featureId: string, value: any, callback: (res: NativeResult<string>) => void) => void
22
22
  getGroupDevices: (tyGroupId: number) => Promise<NativeResult<string>>
23
23
  getSystemTimeFormat: () => Promise<number>
24
+ getMicrophoneAccess: (res:any) => Promise<Result<any>>
24
25
  }
25
26
 
26
27
  export enum UADeviceCategory {
@@ -350,3 +351,15 @@ export const getSystemTimeFormat = async (): Promise<number> => {
350
351
  return 24
351
352
  }
352
353
  }
354
+
355
+ export const getMicrophoneAccess: () => Promise<boolean> = () => {
356
+ return new Promise((resolve, _reject) => {
357
+ devicePanel.getMicrophoneAccess(res => {
358
+ const haveAuthority = (typeof res?.data === 'string') ? !!res?.data && JSON.parse(res?.data)?.haveAuthority : res?.data?.haveAuthority
359
+ if(!res.result || (res.result && haveAuthority !== 'granted')){
360
+ resolve(false)
361
+ }
362
+ resolve(true)
363
+ })
364
+ })
365
+ }
@@ -1,51 +0,0 @@
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