@ledvance/base 1.3.13 → 1.3.15
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 +16 -1
- 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 +16 -1
package/localazy.json
CHANGED
|
@@ -892,6 +892,8 @@
|
|
|
892
892
|
"MATCH:thermostat_energysaving",
|
|
893
893
|
"MATCH:thermostat_editauto",
|
|
894
894
|
"MATCH:add_new_trigger_time_icon_selection_headline_text",
|
|
895
|
+
"MATCH:mood_resetbutton",
|
|
896
|
+
"MATCH:reset_mooddescription",
|
|
895
897
|
"MATCH:thermostat_setscope",
|
|
896
898
|
"MATCH:thermostat_settime",
|
|
897
899
|
"MATCH:thermostat_starttime",
|
|
@@ -903,7 +905,20 @@
|
|
|
903
905
|
"MATCH:thermostat_comforttemp",
|
|
904
906
|
"MATCH:mood_resetbutton",
|
|
905
907
|
"MATCH:reset_mooddescription",
|
|
906
|
-
"MATCH:settings_wateralarmrecovery"
|
|
908
|
+
"MATCH:settings_wateralarmrecovery",
|
|
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"
|
|
907
922
|
],
|
|
908
923
|
"replacements": {
|
|
909
924
|
"REGEX:% %1\\$s.*?\\)%": "{0}",
|
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