@ledvance/base 1.2.41 → 1.2.42

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.2.41",
7
+ "version": "1.2.42",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
10
  "@reduxjs/toolkit": "^1.8.6",
@@ -31,7 +31,7 @@ interface DeviceEvent {
31
31
  }
32
32
 
33
33
  interface TYInfoUpdateType {
34
- devId: string
34
+ devId: string
35
35
  online: boolean
36
36
  }
37
37
 
@@ -58,7 +58,7 @@ export const addListener = (store) => {
58
58
  })
59
59
 
60
60
  groupFeatureListener = nativeEventEmitter.addListener('UAGroupFeatureUpdate', (event: GroupFeatureEvent) => {
61
- if (event.tyGroupId === store.getState().ldvModules.uaGroupInfo.tyGroupId) {
61
+ if (event.tyGroupId == store.getState().ldvModules.uaGroupInfo.tyGroupId) {
62
62
  console.log('长链接刷新Group数据', event)
63
63
  const nativeProps: NativeProps = {
64
64
  familyName: '',
@@ -99,4 +99,4 @@ export const removeListener = () => {
99
99
 
100
100
  groupDeviceListener && groupDeviceListener.remove()
101
101
  groupDeviceListener = null
102
- }
102
+ }
@@ -299,7 +299,7 @@ export function useGroupConfig<T>(): [T, (dps: any, newConfig: T) => Promise<Res
299
299
  const res = await NativeApi.groupControl(tyGroupId, JSON.stringify(dps), JSON.stringify(newConfig))
300
300
  if (res.success) {
301
301
  // 只在结果成功时才改变 redux 数据
302
- dispatch(setGroupConfig(newConfig))
302
+ dispatch(setGroupConfig({...config, ...newConfig}))
303
303
  }
304
304
  return res
305
305
  }, [])
@@ -398,4 +398,4 @@ export {
398
398
  useGroupDevices,
399
399
  useSystemTimeFormate,
400
400
  useEnergieverbrauch,
401
- }
401
+ }