@ledvance/base 1.3.101 → 1.3.103

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.3.101",
7
+ "version": "1.3.103",
8
8
  "scripts": {
9
9
  "prepublishOnly": "python update-localazy.py"
10
10
  },
package/src/api/native.ts CHANGED
@@ -2,6 +2,7 @@ import {NativeModules, Platform} from 'react-native'
2
2
  import {NativeResult, Result} from '../models/modules/Result'
3
3
  import {DpSchema, TYSdk} from 'tuya-panel-kit'
4
4
  import {RoutineParam} from "../utils/interface";
5
+ import {xLog} from '@utils'
5
6
  interface LDVDevicePanelManager {
6
7
  back: () => void
7
8
  control: (params: any, callback: (result: any) => void) => void
@@ -27,6 +28,7 @@ interface LDVDevicePanelManager {
27
28
  getMicrophoneAccess: (res:any) => Promise<Result<any>>
28
29
  firebaseEvent: (dimensions:Record<any, any>) => Promise<NativeResult<any>>
29
30
  appEvent: (action: string, payload: Record<string, any>) => void
31
+ getRoutinesFirstName: (params: Record<any, any>) => Promise<NativeResult<any>>
30
32
  }
31
33
 
32
34
  export enum UADeviceCategory {
@@ -376,6 +378,22 @@ export class NativeApi {
376
378
  msg: nativeResult.msg,
377
379
  }
378
380
  }
381
+
382
+ static async getRoutinesFirstName(devId: string, routineParams: Record<any, any>[]): Promise<string[]>{
383
+ try {
384
+ const nativeResult = await devicePanel.getRoutinesFirstName({
385
+ devId,
386
+ params: JSON.stringify(routineParams)
387
+ })
388
+ if (!nativeResult.result) {
389
+ return routineParams.map(() => '')
390
+ }
391
+ return JSON.parse(nativeResult.data)
392
+ } catch (e) {
393
+ xLog('getRoutinesFirstName error', e)
394
+ return routineParams.map(() => '')
395
+ }
396
+ }
379
397
  }
380
398
 
381
399
  // 打开下载文件
@@ -74,6 +74,7 @@ const getStyles = (theme: ThemeType | undefined) => StyleSheet.create({
74
74
  backgroundColor: theme?.global.background
75
75
  },
76
76
  content: {
77
+ paddingVertical: cx(16),
77
78
  color: theme?.global.fontColor,
78
79
  fontSize: cx(14)
79
80
  }