@ledvance/base 1.3.14 → 1.3.16
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/localazy.json +14 -1
- package/localazy.keys.json +3 -4
- package/package.json +1 -1
- package/src/api/nativeEventEmitter.ts +18 -0
- package/src/composeLayout.tsx +1 -0
- package/src/i18n/strings.ts +377 -0
- package/src/models/modules/NativePropsSlice.tsx +8 -2
- package/translateKey.txt +14 -1
package/localazy.json
CHANGED
|
@@ -906,7 +906,20 @@
|
|
|
906
906
|
"MATCH:mood_resetbutton",
|
|
907
907
|
"MATCH:reset_mooddescription",
|
|
908
908
|
"MATCH:settings_wateralarmrecovery",
|
|
909
|
-
"MATCH:message_repeat"
|
|
909
|
+
"MATCH:message_repeat",
|
|
910
|
+
"MATCH:string_light_pp_sm_headline_add",
|
|
911
|
+
"MATCH:mood_string_mode_shimmer",
|
|
912
|
+
"MATCH:mood_string_mode_fluorescence",
|
|
913
|
+
"MATCH:mood_string_mode_random_flash",
|
|
914
|
+
"MATCH:mood_string_mode_sparkle",
|
|
915
|
+
"MATCH:mood_string_mode_fade",
|
|
916
|
+
"MATCH:mood_string_mode_slow_fade",
|
|
917
|
+
"MATCH:thermostat_cool",
|
|
918
|
+
"MATCH:thermostat_hot",
|
|
919
|
+
"MATCH:thermostat_cold",
|
|
920
|
+
"MATCH:thermostat_warm",
|
|
921
|
+
"MATCH:thermostat_childlock_overview_description_text",
|
|
922
|
+
"MATCH:strip_light_static_mood_add_step_2_headline"
|
|
910
923
|
],
|
|
911
924
|
"replacements": {
|
|
912
925
|
"REGEX:% %1\\$s.*?\\)%": "{0}",
|
package/localazy.keys.json
CHANGED
package/package.json
CHANGED
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
import {actions} from '@models'
|
|
12
12
|
import { cloneDeep } from 'lodash'
|
|
13
13
|
import {DpValue} from "tuya-panel-kit";
|
|
14
|
+
import {NativeApi} from "./native";
|
|
14
15
|
|
|
15
16
|
const nativeModule = NativeModules.LDVDeviceEventEmitter
|
|
16
17
|
|
|
@@ -24,6 +25,9 @@ let groupDpListener: EmitterSubscription | null
|
|
|
24
25
|
interface GroupFeatureEvent {
|
|
25
26
|
tyGroupId: number
|
|
26
27
|
config: string
|
|
28
|
+
name: string
|
|
29
|
+
icon: string
|
|
30
|
+
deviceIds: string
|
|
27
31
|
}
|
|
28
32
|
|
|
29
33
|
interface GroupDpEvent {
|
|
@@ -69,6 +73,7 @@ export const addListener = (store) => {
|
|
|
69
73
|
groupFeatureListener = nativeEventEmitter.addListener('UAGroupFeatureUpdate', (event: GroupFeatureEvent) => {
|
|
70
74
|
const tyGroupId = Number(event.tyGroupId)
|
|
71
75
|
if (tyGroupId == store.getState().ldvModules.uaGroupInfo.tyGroupId) {
|
|
76
|
+
const newDeviceIds = event.deviceIds ? JSON.parse(event.deviceIds) as string[] : []
|
|
72
77
|
console.log('长链接刷新Group数据', event)
|
|
73
78
|
// @ts-ignore
|
|
74
79
|
const nativeProps: NativeProps = {
|
|
@@ -77,11 +82,24 @@ export const addListener = (store) => {
|
|
|
77
82
|
uaGroupInfo: {
|
|
78
83
|
tyGroupId: tyGroupId,
|
|
79
84
|
pId: '',
|
|
85
|
+
name: event.name,
|
|
86
|
+
icon: event.icon,
|
|
80
87
|
config: JSON.parse(event.config),
|
|
81
88
|
dps: {},
|
|
89
|
+
deviceIds: newDeviceIds,
|
|
82
90
|
} as UAGroupInfo,
|
|
83
91
|
}
|
|
84
92
|
store.dispatch(setGroupNativeProps(nativeProps))
|
|
93
|
+
const oldDeviceIds = store.getState().ldvModules.uaGroupInfo.groupDevices.map(device => device.deviceId);
|
|
94
|
+
const oldDeviceIdsStr = oldDeviceIds.slice().sort().join('');
|
|
95
|
+
const newDeviceIdsStr = newDeviceIds.slice().sort().join('');
|
|
96
|
+
if (oldDeviceIdsStr !== newDeviceIdsStr) {
|
|
97
|
+
NativeApi.getGroupDevices(tyGroupId).then(res => {
|
|
98
|
+
if (res.success && Array.isArray(res.data)) {
|
|
99
|
+
store.dispatch(setGroupDevices(res.data))
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
}
|
|
85
103
|
}
|
|
86
104
|
})
|
|
87
105
|
|
package/src/composeLayout.tsx
CHANGED
|
@@ -179,6 +179,7 @@ const composeLayout = (component: React.ComponentType) => {
|
|
|
179
179
|
},
|
|
180
180
|
name: uaGroupInfo.name,
|
|
181
181
|
groupDevices: [],
|
|
182
|
+
icon: !!uaGroupInfo.icon ? uaGroupInfo.icon : undefined,
|
|
182
183
|
deviceIds: uaGroupInfo.deviceIds
|
|
183
184
|
},
|
|
184
185
|
familyName: uaGroupInfo.familyName,
|