@ledvance/base 1.0.15 → 1.0.17

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.0.15",
7
+ "version": "1.0.17",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
10
  "@reduxjs/toolkit": "^1.8.6",
@@ -14,4 +14,6 @@ export declare class NativeApi {
14
14
  static deleteDevice(deviceId: string, isReset: boolean): Promise<NativeResult<any>>;
15
15
  static renameDevice(deviceId: string, name: string): Promise<NativeResult<any>>;
16
16
  static toDeviceSettingsPage(deviceId: string): void;
17
+ static putJson(deviceId: string, featureType: string, json: string): Promise<Result<any>>;
18
+ static getJson(deviceId: string, featureType: string): Promise<Result<string>>;
17
19
  }
package/src/api/native.ts CHANGED
@@ -9,6 +9,8 @@ interface LDVDevicePanelManager {
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
11
  toDeviceSettingsPage: (deviceId: string) => void
12
+ putJson: (deviceId: string, featureType: string, json: string, callback: (res: NativeResult<any>) => void) => void
13
+ getJson: (deviceId: string, featureType: string, callback: (res: NativeResult<string>) => void) => void
12
14
  }
13
15
 
14
16
  const devicePanel: LDVDevicePanelManager = NativeModules.LDVDevicePanelManager
@@ -181,4 +183,28 @@ export class NativeApi {
181
183
  static toDeviceSettingsPage(deviceId: string): void {
182
184
  toDeviceSettingsPage(deviceId)
183
185
  }
186
+
187
+ static putJson(deviceId: string, featureType: string, json: string): Promise<Result<any>> {
188
+ return new Promise<Result<any>>(resolve => {
189
+ devicePanel.putJson(deviceId, featureType, json, nativeRes => {
190
+ resolve({
191
+ success: nativeRes.result,
192
+ data: nativeRes.data,
193
+ msg: nativeRes.msg,
194
+ })
195
+ })
196
+ })
197
+ }
198
+
199
+ static getJson(deviceId: string, featureType: string): Promise<Result<string>> {
200
+ return new Promise<Result<string>>(resolve => {
201
+ devicePanel.getJson(deviceId, featureType, nativeRes => {
202
+ resolve({
203
+ success: nativeRes.result,
204
+ data: nativeRes.data,
205
+ msg: nativeRes.msg,
206
+ })
207
+ })
208
+ })
209
+ }
184
210
  }
@@ -22,7 +22,7 @@ const Tag = (props: TagProps) => {
22
22
  {
23
23
  props.checked &&
24
24
  <Image
25
- source={{ uri: res.ic_arrows_nav_clear }}
25
+ source={res.ic_arrows_nav_clear}
26
26
  style={styles.icon} />
27
27
  }
28
28
  </View>