@ledvance/group-ui-biz-bundle 1.0.19 → 1.0.21

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/group-ui-biz-bundle",
5
5
  "pid": [],
6
6
  "uiid": "",
7
- "version": "1.0.19",
7
+ "version": "1.0.21",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
10
  "@ledvance/base": "^1.x",
@@ -2,7 +2,7 @@ import { useFeatureHook } from "@ledvance/base/src/models/modules/NativePropsSli
2
2
  import { SceneNodeTransitionMode } from "@ledvance/group-ui-biz-bundle/src/modules/mood/SceneInfo";
3
3
  import { parseJSON } from "@tuya/tuya-panel-lamp-sdk/lib/utils";
4
4
  import { cloneDeep } from "lodash";
5
- import { FlagItemInfo, FlagUiInfo, defFlagList } from "./FlagInfo";
5
+ import { FlagItemInfo, FlagUiInfo, defFlagList, def2FlagList, def3FlagList } from "./FlagInfo";
6
6
  import { hex2Int } from "@ledvance/base/src/utils/common";
7
7
  import { spliceByStep } from "@ledvance/base/src/utils/common";
8
8
  import { NativeApi } from "@ledvance/base/src/api/native";
@@ -94,10 +94,6 @@ export function obj2Dp(flagItem: FlagItemInfo, option?: FlagOption): string {
94
94
  }).join('')
95
95
  return version + idHex + whiteHex + colorHex
96
96
  } else {
97
- if (option?.isFan) {
98
- fanEnableHex = (flagItem.fanEnable ? 1 : 0).toString(16).padStart(2, '0')
99
- fanSpeedHex = (flagItem.fanSpeed || 1).toString(16).padStart(2, '0')
100
- }
101
97
  if (!flagItem.speed) {
102
98
  flagItem.speed = 12
103
99
  }
@@ -169,8 +165,6 @@ export function dp2Obj(dp: string, option?: FlagOption): FlagItemInfo | undefine
169
165
  id,
170
166
  mode,
171
167
  speed,
172
- fanEnable,
173
- fanSpeed,
174
168
  colors,
175
169
  whiteColors
176
170
  }
@@ -178,8 +172,11 @@ export function dp2Obj(dp: string, option?: FlagOption): FlagItemInfo | undefine
178
172
 
179
173
  }
180
174
 
181
-
182
- export async function getRemoteFlag(devId: string) {
175
+ interface defFlagOption {
176
+ isDef2?: boolean
177
+ isDef3?: boolean
178
+ }
179
+ export async function getRemoteFlag(devId: string, defFlag?: defFlagOption) {
183
180
  const res = await NativeApi.getJson(devId, featureId)
184
181
  const isNormalData = Array.isArray(parseJSON(res?.data))
185
182
  if (res.success && isNormalData) {
@@ -189,11 +186,12 @@ export async function getRemoteFlag(devId: string) {
189
186
  }
190
187
  } else {
191
188
  if (res.msg?.includes('资源未找到') || !isNormalData) {
192
- const res = await NativeApi.putJson(devId, featureId, JSON.stringify(defFlagList))
189
+ const flags = defFlag?.isDef2 ? def2FlagList : defFlag?.isDef3 ? def3FlagList : defFlagList
190
+ const res = await NativeApi.putJson(devId, featureId, JSON.stringify(flags))
193
191
  if (res.success) {
194
192
  return {
195
193
  success: true,
196
- data: cloneDeep(defFlagList)
194
+ data: cloneDeep(flags)
197
195
  }
198
196
  }
199
197
  return { success: false }
@@ -31,7 +31,7 @@ export const defFlagList: FlagUiInfo[] = [
31
31
  id: 231,
32
32
  version: 0,
33
33
  mode: SceneNodeTransitionMode.Jump,
34
- speed: 70,
34
+ speed: 75,
35
35
  name: I18n.getLang('flag_leverkusen'),
36
36
  whiteColors: [
37
37
  { brightness: 100, colorTemp: 0},
@@ -42,7 +42,7 @@ export const defFlagList: FlagUiInfo[] = [
42
42
  id: 255,
43
43
  version: 0,
44
44
  mode: SceneNodeTransitionMode.Jump,
45
- speed: 70,
45
+ speed: 75,
46
46
  name: I18n.getLang('country_DE'),
47
47
  whiteColors: [
48
48
  { brightness: 100, colorTemp: 0},
@@ -56,7 +56,7 @@ export const defFlagList: FlagUiInfo[] = [
56
56
  id: 254,
57
57
  version: 0,
58
58
  mode: SceneNodeTransitionMode.Jump,
59
- speed: 70,
59
+ speed: 75,
60
60
  name: I18n.getLang('country_BE'),
61
61
  whiteColors: [
62
62
  { brightness: 100, colorTemp: 0},
@@ -67,7 +67,7 @@ export const defFlagList: FlagUiInfo[] = [
67
67
  id: 253,
68
68
  version: 0,
69
69
  mode: SceneNodeTransitionMode.Jump,
70
- speed: 70,
70
+ speed: 75,
71
71
  name: I18n.getLang('country_FR'),
72
72
  whiteColors: [
73
73
  { brightness: 100, colorTemp: 0},
@@ -78,7 +78,7 @@ export const defFlagList: FlagUiInfo[] = [
78
78
  id: 252,
79
79
  version: 0,
80
80
  mode: SceneNodeTransitionMode.Jump,
81
- speed: 70,
81
+ speed: 75,
82
82
  name: I18n.getLang('country_PT'),
83
83
  whiteColors: [
84
84
  { brightness: 100, colorTemp: 0},
@@ -89,7 +89,7 @@ export const defFlagList: FlagUiInfo[] = [
89
89
  id: 251,
90
90
  version: 0,
91
91
  mode: SceneNodeTransitionMode.Jump,
92
- speed: 70,
92
+ speed: 75,
93
93
  name: I18n.getLang('country_scotland'),
94
94
  whiteColors: [
95
95
  { brightness: 100, colorTemp: 0},
@@ -100,18 +100,18 @@ export const defFlagList: FlagUiInfo[] = [
100
100
  id: 250,
101
101
  version: 0,
102
102
  mode: SceneNodeTransitionMode.Jump,
103
- speed: 70,
103
+ speed: 75,
104
104
  name: I18n.getLang('country_ES'),
105
105
  whiteColors: [
106
106
  { brightness: 100, colorTemp: 0},
107
107
  ],
108
- colors: [{h: 357, s: 87, v: 100}, {h: 47, s: 100, v: 100}, {h: 357, s: 87, v: 100}]
108
+ colors: [{h: 360, s: 100, v: 100}, {h: 47, s: 100, v: 100}, {h: 357, s: 87, v: 100}]
109
109
  },
110
110
  {
111
111
  id: 249,
112
112
  version: 0,
113
113
  mode: SceneNodeTransitionMode.Jump,
114
- speed: 70,
114
+ speed: 75,
115
115
  name: I18n.getLang('country_TR'),
116
116
  whiteColors: [
117
117
  { brightness: 100, colorTemp: 0},
@@ -122,7 +122,7 @@ export const defFlagList: FlagUiInfo[] = [
122
122
  id: 248,
123
123
  version: 0,
124
124
  mode: SceneNodeTransitionMode.Jump,
125
- speed: 70,
125
+ speed: 75,
126
126
  name: I18n.getLang('country_AT'),
127
127
  whiteColors: [
128
128
  { brightness: 100, colorTemp: 0},
@@ -133,7 +133,7 @@ export const defFlagList: FlagUiInfo[] = [
133
133
  id: 247,
134
134
  version: 0,
135
135
  mode: SceneNodeTransitionMode.Jump,
136
- speed: 70,
136
+ speed: 75,
137
137
  name: I18n.getLang('country_england'),
138
138
  whiteColors: [
139
139
  { brightness: 100, colorTemp: 0},
@@ -144,7 +144,7 @@ export const defFlagList: FlagUiInfo[] = [
144
144
  id: 246,
145
145
  version: 0,
146
146
  mode: SceneNodeTransitionMode.Jump,
147
- speed: 70,
147
+ speed: 75,
148
148
  name: I18n.getLang('country_HU'),
149
149
  whiteColors: [
150
150
  { brightness: 100, colorTemp: 0},
@@ -155,7 +155,7 @@ export const defFlagList: FlagUiInfo[] = [
155
155
  id: 245,
156
156
  version: 0,
157
157
  mode: SceneNodeTransitionMode.Jump,
158
- speed: 70,
158
+ speed: 75,
159
159
  name: I18n.getLang('country_SK'),
160
160
  whiteColors: [
161
161
  { brightness: 100, colorTemp: 0},
@@ -166,7 +166,7 @@ export const defFlagList: FlagUiInfo[] = [
166
166
  id: 244,
167
167
  version: 0,
168
168
  mode: SceneNodeTransitionMode.Jump,
169
- speed: 70,
169
+ speed: 75,
170
170
  name: I18n.getLang('country_AL'),
171
171
  whiteColors: [
172
172
  { brightness: 100, colorTemp: 0},
@@ -177,7 +177,7 @@ export const defFlagList: FlagUiInfo[] = [
177
177
  id: 243,
178
178
  version: 0,
179
179
  mode: SceneNodeTransitionMode.Jump,
180
- speed: 70,
180
+ speed: 75,
181
181
  name: I18n.getLang('country_DK'),
182
182
  whiteColors: [
183
183
  { brightness: 100, colorTemp: 0},
@@ -188,7 +188,7 @@ export const defFlagList: FlagUiInfo[] = [
188
188
  id: 242,
189
189
  version: 0,
190
190
  mode: SceneNodeTransitionMode.Jump,
191
- speed: 70,
191
+ speed: 75,
192
192
  name: I18n.getLang('country_NL'),
193
193
  whiteColors: [
194
194
  { brightness: 100, colorTemp: 0},
@@ -199,7 +199,7 @@ export const defFlagList: FlagUiInfo[] = [
199
199
  id: 241,
200
200
  version: 0,
201
201
  mode: SceneNodeTransitionMode.Jump,
202
- speed: 70,
202
+ speed: 75,
203
203
  name: I18n.getLang('country_RO'),
204
204
  whiteColors: [
205
205
  { brightness: 100, colorTemp: 0},
@@ -210,7 +210,7 @@ export const defFlagList: FlagUiInfo[] = [
210
210
  id: 240,
211
211
  version: 0,
212
212
  mode: SceneNodeTransitionMode.Jump,
213
- speed: 70,
213
+ speed: 75,
214
214
  name: I18n.getLang('country_CH'),
215
215
  whiteColors: [
216
216
  { brightness: 100, colorTemp: 0},
@@ -221,7 +221,7 @@ export const defFlagList: FlagUiInfo[] = [
221
221
  id: 239,
222
222
  version: 0,
223
223
  mode: SceneNodeTransitionMode.Jump,
224
- speed: 70,
224
+ speed: 75,
225
225
  name: I18n.getLang('country_RS'),
226
226
  whiteColors: [
227
227
  { brightness: 100, colorTemp: 0},
@@ -232,7 +232,7 @@ export const defFlagList: FlagUiInfo[] = [
232
232
  id: 238,
233
233
  version: 0,
234
234
  mode: SceneNodeTransitionMode.Jump,
235
- speed: 70,
235
+ speed: 75,
236
236
  name: I18n.getLang('country_IT'),
237
237
  whiteColors: [
238
238
  { brightness: 100, colorTemp: 0},
@@ -243,7 +243,7 @@ export const defFlagList: FlagUiInfo[] = [
243
243
  id: 237,
244
244
  version: 0,
245
245
  mode: SceneNodeTransitionMode.Jump,
246
- speed: 70,
246
+ speed: 75,
247
247
  name: I18n.getLang('country_CZ'),
248
248
  whiteColors: [
249
249
  { brightness: 100, colorTemp: 0},
@@ -254,7 +254,7 @@ export const defFlagList: FlagUiInfo[] = [
254
254
  id: 236,
255
255
  version: 0,
256
256
  mode: SceneNodeTransitionMode.Jump,
257
- speed: 70,
257
+ speed: 75,
258
258
  name: I18n.getLang('country_SI'),
259
259
  whiteColors: [
260
260
  { brightness: 100, colorTemp: 0},
@@ -265,7 +265,7 @@ export const defFlagList: FlagUiInfo[] = [
265
265
  id: 235,
266
266
  version: 0,
267
267
  mode: SceneNodeTransitionMode.Jump,
268
- speed: 70,
268
+ speed: 75,
269
269
  name: I18n.getLang('country_HR'),
270
270
  whiteColors: [
271
271
  { brightness: 100, colorTemp: 0},
@@ -276,7 +276,7 @@ export const defFlagList: FlagUiInfo[] = [
276
276
  id: 234,
277
277
  version: 0,
278
278
  mode: SceneNodeTransitionMode.Jump,
279
- speed: 70,
279
+ speed: 75,
280
280
  name: I18n.getLang('country_SE'),
281
281
  whiteColors: [
282
282
  { brightness: 100, colorTemp: 0},
@@ -287,7 +287,7 @@ export const defFlagList: FlagUiInfo[] = [
287
287
  id: 233,
288
288
  version: 0,
289
289
  mode: SceneNodeTransitionMode.Jump,
290
- speed: 70,
290
+ speed: 75,
291
291
  name: I18n.getLang('country_NO'),
292
292
  whiteColors: [
293
293
  { brightness: 100, colorTemp: 0},
@@ -298,7 +298,7 @@ export const defFlagList: FlagUiInfo[] = [
298
298
  id: 232,
299
299
  version: 0,
300
300
  mode: SceneNodeTransitionMode.Jump,
301
- speed: 70,
301
+ speed: 75,
302
302
  name: I18n.getLang('country_PL'),
303
303
  whiteColors: [
304
304
  { brightness: 100, colorTemp: 0},
@@ -306,3 +306,570 @@ export const defFlagList: FlagUiInfo[] = [
306
306
  colors: [{h: 360, s: 100, v: 100}, {h: 0, s: 0, v: 100}]
307
307
  },
308
308
  ]
309
+
310
+ export const def2Pids = ['k588eygmfkdzmpzm']
311
+ // k588eygmfkdzmpzm
312
+ export const def2FlagList: FlagUiInfo[] = [
313
+ {
314
+ id: 231,
315
+ version: 0,
316
+ mode: SceneNodeTransitionMode.Jump,
317
+ speed: 75,
318
+ name: I18n.getLang('flag_leverkusen'),
319
+ whiteColors: [
320
+ { brightness: 100, colorTemp: 0},
321
+ ],
322
+ colors: [{h: 360, s: 100, v: 100}, {h: 0, s: 0, v: 100}, {h: 0, s: 0, v: 100}, {h: 60, s: 100, v: 100}]
323
+ },
324
+ {
325
+ id: 255,
326
+ version: 0,
327
+ mode: SceneNodeTransitionMode.Jump,
328
+ speed: 75,
329
+ name: I18n.getLang('country_DE'),
330
+ whiteColors: [
331
+ { brightness: 100, colorTemp: 0},
332
+ ],
333
+ colors: [
334
+ {h: 48, s: 100, v: 100},
335
+ {h: 360, s: 100, v: 100},
336
+ {h: 0, s: 85, v: 46},
337
+ {h: 0, s: 0, v:0}],
338
+ },
339
+ {
340
+ id: 254,
341
+ version: 0,
342
+ mode: SceneNodeTransitionMode.Jump,
343
+ speed: 75,
344
+ name: I18n.getLang('country_BE'),
345
+ whiteColors: [
346
+ { brightness: 100, colorTemp: 0},
347
+ ],
348
+ colors: [{h: 360, s: 100, v: 100}, {h: 48, s: 100, v: 100}, {h: 48, s: 99, v: 58}, {h: 0, s: 0, v: 0}]
349
+ },
350
+ {
351
+ id: 253,
352
+ version: 0,
353
+ mode: SceneNodeTransitionMode.Jump,
354
+ speed: 75,
355
+ name: I18n.getLang('country_FR'),
356
+ whiteColors: [
357
+ { brightness: 100, colorTemp: 0},
358
+ ],
359
+ colors: [{h: 360, s: 100, v: 100}, {h: 0, s: 0, v: 100}, {h: 0, s: 0, v: 100}, {h: 212, s: 100, v: 100}]
360
+ },
361
+ {
362
+ id: 252,
363
+ version: 0,
364
+ mode: SceneNodeTransitionMode.Jump,
365
+ speed: 75,
366
+ name: I18n.getLang('country_PT'),
367
+ whiteColors: [
368
+ { brightness: 100, colorTemp: 0},
369
+ ],
370
+ colors: [{h: 360, s: 100, v: 100}, {h: 360, s: 100, v: 100}, {h: 360, s: 100, v: 100}, {h: 150, s: 96, v: 100}]
371
+ },
372
+ {
373
+ id: 251,
374
+ version: 0,
375
+ mode: SceneNodeTransitionMode.Jump,
376
+ speed: 75,
377
+ name: I18n.getLang('country_scotland'),
378
+ whiteColors: [
379
+ { brightness: 100, colorTemp: 0},
380
+ ],
381
+ colors: [{h: 209, s: 86, v: 100}, {h: 0, s: 0, v: 100}, {h: 0, s: 0, v: 100}, {h: 209, s: 86, v: 100}]
382
+ },
383
+ {
384
+ id: 250,
385
+ version: 0,
386
+ mode: SceneNodeTransitionMode.Jump,
387
+ speed: 75,
388
+ name: I18n.getLang('country_ES'),
389
+ whiteColors: [
390
+ { brightness: 100, colorTemp: 0},
391
+ ],
392
+ colors: [{h: 360, s: 100, v: 100}, {h: 47, s: 100, v: 100}, {h: 47, s: 100, v: 100}, {h: 357, s: 87, v: 100}]
393
+ },
394
+ {
395
+ id: 249,
396
+ version: 0,
397
+ mode: SceneNodeTransitionMode.Jump,
398
+ speed: 75,
399
+ name: I18n.getLang('country_TR'),
400
+ whiteColors: [
401
+ { brightness: 100, colorTemp: 0},
402
+ ],
403
+ colors: [{h: 360, s: 100, v: 100}, {h: 360, s: 100, v: 100}, {h: 0, s: 0, v: 100}, {h: 360, s: 100, v: 100}]
404
+ },
405
+ {
406
+ id: 248,
407
+ version: 0,
408
+ mode: SceneNodeTransitionMode.Jump,
409
+ speed: 75,
410
+ name: I18n.getLang('country_AT'),
411
+ whiteColors: [
412
+ { brightness: 100, colorTemp: 0},
413
+ ],
414
+ colors: [{h: 360, s: 100, v: 100}, {h: 0, s: 0, v: 100}, {h: 0, s: 0, v: 100}, {h: 360, s: 100, v: 100}]
415
+ },
416
+ {
417
+ id: 247,
418
+ version: 0,
419
+ mode: SceneNodeTransitionMode.Jump,
420
+ speed: 75,
421
+ name: I18n.getLang('country_england'),
422
+ whiteColors: [
423
+ { brightness: 100, colorTemp: 0},
424
+ ],
425
+ colors: [{h: 0, s: 0, v: 100}, {h: 360, s: 100, v: 100}, {h: 0, s: 0, v: 100}, {h: 0, s: 0, v: 100}]
426
+ },
427
+ {
428
+ id: 246,
429
+ version: 0,
430
+ mode: SceneNodeTransitionMode.Jump,
431
+ speed: 75,
432
+ name: I18n.getLang('country_HU'),
433
+ whiteColors: [
434
+ { brightness: 100, colorTemp: 0},
435
+ ],
436
+ colors: [{h: 133, s: 36, v: 100}, {h: 0, s: 0, v: 100}, {h: 0, s: 0, v: 100},{h: 360, s: 100, v: 100}]
437
+ },
438
+ {
439
+ id: 245,
440
+ version: 0,
441
+ mode: SceneNodeTransitionMode.Jump,
442
+ speed: 75,
443
+ name: I18n.getLang('country_SK'),
444
+ whiteColors: [
445
+ { brightness: 100, colorTemp: 0},
446
+ ],
447
+ colors: [{h: 360, s: 100, v: 100}, {h: 213, s: 93, v: 100}, {h: 0, s: 0, v: 100}, {h: 0, s: 0, v: 100}]
448
+ },
449
+ {
450
+ id: 244,
451
+ version: 0,
452
+ mode: SceneNodeTransitionMode.Jump,
453
+ speed: 75,
454
+ name: I18n.getLang('country_AL'),
455
+ whiteColors: [
456
+ { brightness: 100, colorTemp: 0},
457
+ ],
458
+ colors: [{h: 360, s: 100, v: 100}, {h: 0, s: 0, v:0}, {h: 0, s: 0, v:0}, {h: 360, s: 100, v: 100}]
459
+ },
460
+ {
461
+ id: 243,
462
+ version: 0,
463
+ mode: SceneNodeTransitionMode.Jump,
464
+ speed: 75,
465
+ name: I18n.getLang('country_DK'),
466
+ whiteColors: [
467
+ { brightness: 100, colorTemp: 0},
468
+ ],
469
+ colors: [{h: 360, s: 100, v: 100}, {h: 0, s: 0, v:100}, {h: 0, s: 0, v:100}, {h: 360, s: 100, v: 100}]
470
+ },
471
+ {
472
+ id: 242,
473
+ version: 0,
474
+ mode: SceneNodeTransitionMode.Jump,
475
+ speed: 75,
476
+ name: I18n.getLang('country_NL'),
477
+ whiteColors: [
478
+ { brightness: 100, colorTemp: 0},
479
+ ],
480
+ colors: [{h: 217, s: 100, v: 100}, {h: 0, s: 0, v:100}, {h: 0, s: 0, v:100}, {h: 360, s: 100, v: 100}]
481
+ },
482
+ {
483
+ id: 241,
484
+ version: 0,
485
+ mode: SceneNodeTransitionMode.Jump,
486
+ speed: 75,
487
+ name: I18n.getLang('country_RO'),
488
+ whiteColors: [
489
+ { brightness: 100, colorTemp: 0},
490
+ ],
491
+ colors: [{h: 360, s: 100, v: 100}, {h: 48, s: 91, v: 100}, {h: 219, s: 100, v: 100}]
492
+ },
493
+ {
494
+ id: 240,
495
+ version: 0,
496
+ mode: SceneNodeTransitionMode.Jump,
497
+ speed: 75,
498
+ name: I18n.getLang('country_CH'),
499
+ whiteColors: [
500
+ { brightness: 100, colorTemp: 0},
501
+ ],
502
+ colors: [{h: 360, s: 100, v: 100}, {h: 0, s: 0, v: 100}, {h: 360, s: 100, v: 100}]
503
+ },
504
+ {
505
+ id: 239,
506
+ version: 0,
507
+ mode: SceneNodeTransitionMode.Jump,
508
+ speed: 75,
509
+ name: I18n.getLang('country_RS'),
510
+ whiteColors: [
511
+ { brightness: 100, colorTemp: 0},
512
+ ],
513
+ colors: [{h: 360, s: 100, v: 100}, {h: 231, s: 100, v: 100}, {h: 0, s: 0, v: 100},{h: 0, s: 0, v: 100}]
514
+ },
515
+ {
516
+ id: 238,
517
+ version: 0,
518
+ mode: SceneNodeTransitionMode.Jump,
519
+ speed: 75,
520
+ name: I18n.getLang('country_IT'),
521
+ whiteColors: [
522
+ { brightness: 100, colorTemp: 0},
523
+ ],
524
+ colors: [{h: 360, s: 100, v: 100}, {h: 0, s: 0, v: 100},{h: 0, s: 0, v: 100}, {h: 149, s: 100, v: 100}]
525
+ },
526
+ {
527
+ id: 237,
528
+ version: 0,
529
+ mode: SceneNodeTransitionMode.Jump,
530
+ speed: 75,
531
+ name: I18n.getLang('country_CZ'),
532
+ whiteColors: [
533
+ { brightness: 100, colorTemp: 0},
534
+ ],
535
+ colors: [{h: 360, s: 100, v: 100}, {h: 0, s: 0, v: 100}, {h: 0, s: 0, v: 100}, {h: 211, s: 99, v: 100}]
536
+ },
537
+ {
538
+ id: 236,
539
+ version: 0,
540
+ mode: SceneNodeTransitionMode.Jump,
541
+ speed: 75,
542
+ name: I18n.getLang('country_SI'),
543
+ whiteColors: [
544
+ { brightness: 100, colorTemp: 0},
545
+ ],
546
+ colors: [{h: 360, s: 100, v: 100}, {h: 217, s: 100, v: 100}, {h: 0, s: 0, v: 100}, {h: 0, s: 0, v: 100}]
547
+ },
548
+ {
549
+ id: 235,
550
+ version: 0,
551
+ mode: SceneNodeTransitionMode.Jump,
552
+ speed: 75,
553
+ name: I18n.getLang('country_HR'),
554
+ whiteColors: [
555
+ { brightness: 100, colorTemp: 0},
556
+ ],
557
+ colors: [{h: 231, s: 100, v: 100}, {h: 0, s: 0, v: 100},{h: 0, s: 0, v: 100}, {h: 360, s: 100, v: 100}]
558
+ },
559
+ {
560
+ id: 234,
561
+ version: 0,
562
+ mode: SceneNodeTransitionMode.Jump,
563
+ speed: 75,
564
+ name: I18n.getLang('country_SE'),
565
+ whiteColors: [
566
+ { brightness: 100, colorTemp: 0},
567
+ ],
568
+ colors: [{h: 201, s: 100, v: 100}, {h: 48, s: 99, v: 100},{h: 48, s: 99, v: 100}, {h: 201, s: 100, v: 100}]
569
+ },
570
+ {
571
+ id: 233,
572
+ version: 0,
573
+ mode: SceneNodeTransitionMode.Jump,
574
+ speed: 75,
575
+ name: I18n.getLang('country_NO'),
576
+ whiteColors: [
577
+ { brightness: 100, colorTemp: 0},
578
+ ],
579
+ colors: [{h: 0, s: 0, v: 100}, {h: 231, s: 100, v: 100}, {h: 360, s: 100, v: 100}, {h: 360, s: 100, v: 100}]
580
+ },
581
+ {
582
+ id: 232,
583
+ version: 0,
584
+ mode: SceneNodeTransitionMode.Jump,
585
+ speed: 75,
586
+ name: I18n.getLang('country_PL'),
587
+ whiteColors: [
588
+ { brightness: 100, colorTemp: 0},
589
+ ],
590
+ colors: [{h: 360, s: 100, v: 100}, {h: 0, s: 0, v: 100}]
591
+ }
592
+ ]
593
+
594
+ export const def3Pids = ['uzoammz8zm0onv1i', '85bmfxhxpmwj7exf']
595
+ // uzoammz8zm0onv1i 85bmfxhxpmwj7exf
596
+ export const def3FlagList: FlagUiInfo[] = [
597
+ {
598
+ id: 231,
599
+ version: 0,
600
+ mode: SceneNodeTransitionMode.Jump,
601
+ speed: 75,
602
+ name: I18n.getLang('flag_leverkusen'),
603
+ whiteColors: [
604
+ { brightness: 100, colorTemp: 0},
605
+ ],
606
+ colors: [{h: 360, s: 100, v: 100}, {h: 0, s: 0, v: 100}, {h: 60, s: 100, v: 100}]
607
+ },
608
+ {
609
+ id: 255,
610
+ version: 0,
611
+ mode: SceneNodeTransitionMode.Jump,
612
+ speed: 75,
613
+ name: I18n.getLang('country_DE'),
614
+ whiteColors: [
615
+ { brightness: 100, colorTemp: 0},
616
+ ],
617
+ colors: [
618
+ {h: 48, s: 100, v: 100},
619
+ {h: 360, s: 100, v: 100},
620
+ {h: 0, s: 0, v:0}],
621
+ },
622
+ {
623
+ id: 254,
624
+ version: 0,
625
+ mode: SceneNodeTransitionMode.Jump,
626
+ speed: 75,
627
+ name: I18n.getLang('country_BE'),
628
+ whiteColors: [
629
+ { brightness: 100, colorTemp: 0},
630
+ ],
631
+ colors: [{h: 360, s: 100, v: 100}, {h: 48, s: 100, v: 100}, {h: 0, s: 0, v: 0}]
632
+ },
633
+ {
634
+ id: 253,
635
+ version: 0,
636
+ mode: SceneNodeTransitionMode.Jump,
637
+ speed: 75,
638
+ name: I18n.getLang('country_FR'),
639
+ whiteColors: [
640
+ { brightness: 100, colorTemp: 0},
641
+ ],
642
+ colors: [{h: 360, s: 100, v: 100}, {h: 0, s: 0, v: 100}, {h: 212, s: 100, v: 100}]
643
+ },
644
+ {
645
+ id: 252,
646
+ version: 0,
647
+ mode: SceneNodeTransitionMode.Jump,
648
+ speed: 75,
649
+ name: I18n.getLang('country_PT'),
650
+ whiteColors: [
651
+ { brightness: 100, colorTemp: 0},
652
+ ],
653
+ colors: [{h: 360, s: 100, v: 100}, {h: 360, s: 100, v: 100}, {h: 120, s: 96, v: 100}]
654
+ },
655
+ {
656
+ id: 251,
657
+ version: 0,
658
+ mode: SceneNodeTransitionMode.Jump,
659
+ speed: 75,
660
+ name: I18n.getLang('country_scotland'),
661
+ whiteColors: [
662
+ { brightness: 100, colorTemp: 0},
663
+ ],
664
+ colors: [{h: 209, s: 100, v: 100}, {h: 0, s: 0, v: 100}, {h: 209, s: 100, v: 100}]
665
+ },
666
+ {
667
+ id: 250,
668
+ version: 0,
669
+ mode: SceneNodeTransitionMode.Jump,
670
+ speed: 75,
671
+ name: I18n.getLang('country_ES'),
672
+ whiteColors: [
673
+ { brightness: 100, colorTemp: 0},
674
+ ],
675
+ colors: [{h: 360, s: 100, v: 100}, {h: 47, s: 100, v: 100}, {h: 360, s: 100, v: 100}]
676
+ },
677
+ {
678
+ id: 249,
679
+ version: 0,
680
+ mode: SceneNodeTransitionMode.Jump,
681
+ speed: 75,
682
+ name: I18n.getLang('country_TR'),
683
+ whiteColors: [
684
+ { brightness: 100, colorTemp: 0},
685
+ ],
686
+ colors: [{h: 360, s: 100, v: 100}, {h: 360, s: 100, v: 100}, {h: 0, s: 0, v: 100}]
687
+ },
688
+ {
689
+ id: 248,
690
+ version: 0,
691
+ mode: SceneNodeTransitionMode.Jump,
692
+ speed: 75,
693
+ name: I18n.getLang('country_AT'),
694
+ whiteColors: [
695
+ { brightness: 100, colorTemp: 0},
696
+ ],
697
+ colors: [{h: 360, s: 100, v: 100}, {h: 0, s: 0, v: 100}, {h: 360, s: 100, v: 100}]
698
+ },
699
+ {
700
+ id: 247,
701
+ version: 0,
702
+ mode: SceneNodeTransitionMode.Jump,
703
+ speed: 75,
704
+ name: I18n.getLang('country_england'),
705
+ whiteColors: [
706
+ { brightness: 100, colorTemp: 0},
707
+ ],
708
+ colors: [{h: 0, s: 0, v: 100}, {h: 360, s: 100, v: 100}, {h: 0, s: 0, v: 100}]
709
+ },
710
+ {
711
+ id: 246,
712
+ version: 0,
713
+ mode: SceneNodeTransitionMode.Jump,
714
+ speed: 75,
715
+ name: I18n.getLang('country_HU'),
716
+ whiteColors: [
717
+ { brightness: 100, colorTemp: 0},
718
+ ],
719
+ colors: [{h: 120, s: 100, v: 58}, {h: 0, s: 0, v: 100}, {h: 360, s: 100, v: 100}]
720
+ },
721
+ {
722
+ id: 245,
723
+ version: 0,
724
+ mode: SceneNodeTransitionMode.Jump,
725
+ speed: 75,
726
+ name: I18n.getLang('country_SK'),
727
+ whiteColors: [
728
+ { brightness: 100, colorTemp: 0},
729
+ ],
730
+ colors: [{h: 360, s: 100, v: 100}, {h: 213, s: 100, v: 84}, {h: 0, s: 0, v: 100}]
731
+ },
732
+ {
733
+ id: 244,
734
+ version: 0,
735
+ mode: SceneNodeTransitionMode.Jump,
736
+ speed: 75,
737
+ name: I18n.getLang('country_AL'),
738
+ whiteColors: [
739
+ { brightness: 100, colorTemp: 0},
740
+ ],
741
+ colors: [{h: 360, s: 100, v: 100}, {h: 0, s: 0, v:0}, {h: 360, s: 100, v: 100}]
742
+ },
743
+ {
744
+ id: 243,
745
+ version: 0,
746
+ mode: SceneNodeTransitionMode.Jump,
747
+ speed: 75,
748
+ name: I18n.getLang('country_DK'),
749
+ whiteColors: [
750
+ { brightness: 100, colorTemp: 0},
751
+ ],
752
+ colors: [{h: 360, s: 100, v: 100}, {h: 0, s: 0, v:100}, {h: 360, s: 100, v: 100}, {h: 0, s: 0, v:100}]
753
+ },
754
+ {
755
+ id: 242,
756
+ version: 0,
757
+ mode: SceneNodeTransitionMode.Jump,
758
+ speed: 75,
759
+ name: I18n.getLang('country_NL'),
760
+ whiteColors: [
761
+ { brightness: 100, colorTemp: 0},
762
+ ],
763
+ colors: [{h: 217, s: 100, v: 77}, {h: 0, s: 0, v:0}, {h: 360, s: 100, v: 100}]
764
+ },
765
+ {
766
+ id: 241,
767
+ version: 0,
768
+ mode: SceneNodeTransitionMode.Jump,
769
+ speed: 75,
770
+ name: I18n.getLang('country_RO'),
771
+ whiteColors: [
772
+ { brightness: 100, colorTemp: 0},
773
+ ],
774
+ colors: [{h: 360, s: 100, v: 100}, {h: 48, s: 91, v: 100}, {h: 219, s: 100, v: 100}]
775
+ },
776
+ {
777
+ id: 240,
778
+ version: 0,
779
+ mode: SceneNodeTransitionMode.Jump,
780
+ speed: 75,
781
+ name: I18n.getLang('country_CH'),
782
+ whiteColors: [
783
+ { brightness: 100, colorTemp: 0},
784
+ ],
785
+ colors: [{h: 360, s: 100, v: 100}, {h: 0, s: 0, v: 100}, {h: 360, s: 100, v: 100}]
786
+ },
787
+ {
788
+ id: 239,
789
+ version: 0,
790
+ mode: SceneNodeTransitionMode.Jump,
791
+ speed: 75,
792
+ name: I18n.getLang('country_RS'),
793
+ whiteColors: [
794
+ { brightness: 100, colorTemp: 0},
795
+ ],
796
+ colors: [{h: 0, s: 0, v: 100}, {h: 210, s: 100, v: 100}, {h: 360, s: 100, v: 100}]
797
+ },
798
+ {
799
+ id: 238,
800
+ version: 0,
801
+ mode: SceneNodeTransitionMode.Jump,
802
+ speed: 75,
803
+ name: I18n.getLang('country_IT'),
804
+ whiteColors: [
805
+ { brightness: 100, colorTemp: 0},
806
+ ],
807
+ colors: [{h: 360, s: 100, v: 100}, {h: 212, s: 4, v: 100}, {h: 120, s: 100, v: 100}]
808
+ },
809
+ {
810
+ id: 237,
811
+ version: 0,
812
+ mode: SceneNodeTransitionMode.Jump,
813
+ speed: 75,
814
+ name: I18n.getLang('country_CZ'),
815
+ whiteColors: [
816
+ { brightness: 100, colorTemp: 0},
817
+ ],
818
+ colors: [{h: 360, s: 100, v: 100}, {h: 0, s: 0, v: 100}, {h: 211, s: 100, v: 100}]
819
+ },
820
+ {
821
+ id: 236,
822
+ version: 0,
823
+ mode: SceneNodeTransitionMode.Jump,
824
+ speed: 75,
825
+ name: I18n.getLang('country_SI'),
826
+ whiteColors: [
827
+ { brightness: 100, colorTemp: 0},
828
+ ],
829
+ colors: [{h: 360, s: 100, v: 100}, {h: 217, s: 100, v: 100}, {h: 0, s: 0, v: 100}]
830
+ },
831
+ {
832
+ id: 235,
833
+ version: 0,
834
+ mode: SceneNodeTransitionMode.Jump,
835
+ speed: 75,
836
+ name: I18n.getLang('country_HR'),
837
+ whiteColors: [
838
+ { brightness: 100, colorTemp: 0},
839
+ ],
840
+ colors: [{h: 0, s: 0, v: 100}, {h: 220, s: 89, v: 100}, {h: 360, s: 100, v: 100}]
841
+ },
842
+ {
843
+ id: 234,
844
+ version: 0,
845
+ mode: SceneNodeTransitionMode.Jump,
846
+ speed: 75,
847
+ name: I18n.getLang('country_SE'),
848
+ whiteColors: [
849
+ { brightness: 100, colorTemp: 0},
850
+ ],
851
+ colors: [{h: 201, s: 100, v: 100}, {h: 48, s: 99, v: 100}, {h: 201, s: 100, v: 100}]
852
+ },
853
+ {
854
+ id: 233,
855
+ version: 0,
856
+ mode: SceneNodeTransitionMode.Jump,
857
+ speed: 75,
858
+ name: I18n.getLang('country_NO'),
859
+ whiteColors: [
860
+ { brightness: 100, colorTemp: 0},
861
+ ],
862
+ colors: [{h: 0, s: 0, v: 100}, {h: 218, s: 100, v: 100}, {h: 360, s: 100, v: 100}]
863
+ },
864
+ {
865
+ id: 232,
866
+ version: 0,
867
+ mode: SceneNodeTransitionMode.Jump,
868
+ speed: 75,
869
+ name: I18n.getLang('country_PL'),
870
+ whiteColors: [
871
+ { brightness: 100, colorTemp: 0},
872
+ ],
873
+ colors: [{h: 360, s: 100, v: 100}, {h: 0, s: 0, v: 100}]
874
+ },
875
+ ]
@@ -5,11 +5,11 @@ import { FlatList } from "react-native";
5
5
  import Spacer from "@ledvance/base/src/components/Spacer";
6
6
  import { Utils } from "tuya-panel-kit";
7
7
  import FlagItem from "./FlagItem";
8
- import { FlagUiInfo } from "./FlagInfo";
8
+ import { FlagUiInfo, def2Pids, def3Pids } from "./FlagInfo";
9
9
  import { getRemoteFlag, saveFlag, saveFlagMode, useFlag } from "./FlagActions";
10
10
  import { useRoute, useNavigation } from '@react-navigation/core'
11
11
  import I18n from "@ledvance/base/src/i18n";
12
- import { useReactive } from "ahooks";
12
+ import { useReactive, useUpdateEffect } from "ahooks";
13
13
  import { cloneDeep, difference, isEqual, last, map, range } from "lodash";
14
14
  import { ui_biz_routerKey } from "../../navigation/Routers";
15
15
  import res from "@ledvance/base/src/res";
@@ -17,6 +17,7 @@ import { hsv2Hex } from "@ledvance/base/src/utils";
17
17
  import { SceneNodeTransitionMode } from "@ledvance/group-ui-biz-bundle/src/modules/mood/SceneInfo";
18
18
  import { Result } from "@ledvance/base/src/models/modules/Result";
19
19
  import { WorkMode } from "@ledvance/base/src/utils/interface";
20
+ import TextField from "@ledvance/base/src/components/TextField";
20
21
  const cx = Utils.RatioUtils.convertX
21
22
 
22
23
  export interface FlagPageProps {
@@ -51,7 +52,8 @@ const FlagPage = () => {
51
52
  const state = useReactive({
52
53
  loading: true,
53
54
  flags: cloneDeep(flags) as FlagUiInfo[],
54
- moods: params.isStripLight ? [] : cloneDeep(moods)
55
+ moods: params.isStripLight ? [] : cloneDeep(moods),
56
+ searchText: ''
55
57
  })
56
58
  const defParams = {
57
59
  workModeDpCode: params.workModeCode,
@@ -69,6 +71,7 @@ const FlagPage = () => {
69
71
  if (flagState && state.flags?.length) {
70
72
  const { flag } = flagState
71
73
  if(params.isStripLight && flag?.colors !== undefined){
74
+ if(flagMode?.flagId !== undefined) return flagMode.flagId
72
75
  const v = state.flags.find(item => {
73
76
  return isEqual(item.colors, flag?.colors)
74
77
  })
@@ -80,7 +83,7 @@ const FlagPage = () => {
80
83
  }
81
84
 
82
85
  return -1
83
- }, [JSON.stringify(flagState), JSON.stringify(state.flags)])
86
+ }, [JSON.stringify(flagState), JSON.stringify(state.flags), flagMode])
84
87
 
85
88
  useEffect(() => {
86
89
  if(!flags?.length){
@@ -96,8 +99,17 @@ const FlagPage = () => {
96
99
  }
97
100
  }, [])
98
101
 
102
+ useUpdateEffect(() =>{
103
+ state.flags = state.searchText !== '' ? cloneDeep(flags).filter(flag => flag.name.includes(state.searchText)) : cloneDeep(flags)
104
+ }, [state.searchText, flags])
105
+
99
106
  const getRemoteFlagInfo = async () => {
100
- const res = await getRemoteFlag(uaGroupInfo.tyGroupId.toString())
107
+ const defNum = uaGroupInfo.groupDevices.filter(device => !(def2Pids.includes(device.tyPid) || def3Pids.includes(device.tyPid))).length
108
+ const def2Num = uaGroupInfo.groupDevices.filter(device => def2Pids.includes(device.tyPid)).length
109
+ const def3Num = uaGroupInfo.groupDevices.filter(device => def3Pids.includes(device.tyPid)).length
110
+ const isDef2 = def2Num > def3Num && def2Num > defNum
111
+ const isDef3 = def3Num > def2Num && def3Num > defNum
112
+ const res = await getRemoteFlag(uaGroupInfo.tyGroupId.toString(), {isDef2, isDef3})
101
113
  if (res.success) {
102
114
  let cloneFlag: FlagUiInfo[] = cloneDeep(res.data) || []
103
115
  if(!params.drawToolLight){
@@ -147,27 +159,38 @@ const FlagPage = () => {
147
159
  if (res.success) {
148
160
  state.flags = cloneDeep(newScene)
149
161
  setFlags(cloneDeep(newScene))
150
- if(mode === 'del' && flagState?.flag && (checkedMood.id !== flagState.flag.id)){
162
+ if(mode === 'del' && flagState?.flag && (checkedMood.id !== flagId)){
151
163
  return{
152
164
  success: true
153
165
  }
154
166
  }
155
- updateFlagMode()
156
- return setFlag({
157
- ...defParams,
158
- flag: cloneDeep(mood)
159
- })
167
+ if(mood){
168
+ setFlag({
169
+ ...defParams,
170
+ flag: cloneDeep(mood)
171
+ }).then()
172
+ updateFlagMode(true, mood)
173
+ }else{
174
+ updateFlagMode(false)
175
+ }
176
+ return {
177
+ success: true
178
+ }
160
179
  }
161
180
  return {
162
181
  success: false
163
182
  }
164
183
  }
165
184
 
166
- const updateFlagMode = () =>{
167
- if(!flagMode){
168
- saveFlagMode(uaGroupInfo.tyGroupId.toString(), JSON.stringify(true)).then()
169
- setFlagMode(true)
170
- }
185
+ const updateFlagMode = (flagMode: boolean, flag?:FlagUiInfo) =>{
186
+ saveFlagMode(uaGroupInfo.tyGroupId.toString(), JSON.stringify({
187
+ flagMode,
188
+ flagId: flag?.id
189
+ })).then()
190
+ setFlagMode({
191
+ flagMode,
192
+ flagId: flag?.id
193
+ })
171
194
  }
172
195
 
173
196
  return (
@@ -180,7 +203,6 @@ const FlagPage = () => {
180
203
  ...state.flags,
181
204
  ...state.moods
182
205
  ], 'id')
183
- console.log(useIds, '< --- useIds')
184
206
  const idRange = range(0, 256)
185
207
  const unuseId = last(difference(idRange, useIds))
186
208
  if (unuseId !== undefined) {
@@ -188,6 +210,13 @@ const FlagPage = () => {
188
210
  }
189
211
  }}
190
212
  >
213
+ <TextField
214
+ style={{marginHorizontal: cx(24)}}
215
+ value={state.searchText}
216
+ onChangeText={(v)=>{
217
+ state.searchText = v
218
+ }}
219
+ />
191
220
  <FlatList
192
221
  data={state.flags}
193
222
  renderItem={({ item }) => <FlagItem
@@ -201,7 +230,7 @@ const FlagPage = () => {
201
230
  ...defParams,
202
231
  flag: cloneDeep(item),
203
232
  })
204
- updateFlagMode()
233
+ updateFlagMode(true, item)
205
234
  }
206
235
  }}
207
236
  onPress={() => {
@@ -33,7 +33,7 @@ interface MoodPageUIState extends ScenePageUIState {
33
33
  export interface MoodPageProps {
34
34
  switchLedDpCode: string
35
35
  sceneDataDpCode: string
36
- mixSceneDataDpCode: string
36
+ mixSceneDataDpCode?: string
37
37
  workModeDpCode: string
38
38
  isSupportFan?: boolean
39
39
  isSupportUVC?: boolean
@@ -32,7 +32,7 @@ export function useSwitchLed(): [boolean, (value: boolean) => Promise<Result<any
32
32
 
33
33
  interface SceneDataType {
34
34
  sceneDataDpCode: string
35
- mixSceneDataDpCode: string
35
+ mixSceneDataDpCode?: string
36
36
  scene?: SceneUIState
37
37
  workModeDpCode: string
38
38
  workMode: WorkMode
@@ -32,6 +32,7 @@ import SocketItem from '@ledvance/base/src/components/SocketItem'
32
32
  import { WorkMode } from "@ledvance/base/src/utils/interface";
33
33
  import { Buffer } from 'buffer'
34
34
  import { fanModeOption, actionOption } from "./TimeScheduleActions";
35
+ import LoadingView from "@ledvance/base/src/components/LoadingView";
35
36
 
36
37
  const { convertX: cx } = Utils.RatioUtils;
37
38
  const { toFixedString } = Utils.NumberUtils;
@@ -65,7 +66,8 @@ const TimeScheduleDetailPage = () => {
65
66
  hsv: defaultHsv(),
66
67
  stripState: defaultStripState(),
67
68
  scene: '',
68
- loading: false
69
+ loading: false,
70
+ moodLoading: false
69
71
  })
70
72
 
71
73
  const tabList = useCreation(() => {
@@ -113,6 +115,7 @@ const TimeScheduleDetailPage = () => {
113
115
 
114
116
  useEffect(() => {
115
117
  if (!(moods && moods.length) && props.sceneDataCode) {
118
+ state.moodLoading = true
116
119
  getRemoteSceneList(uaGroupInfo.tyGroupId.toString(), {
117
120
  isSupportColor: props.isSupportColor,
118
121
  isSupportTemperature: props.isSupportTemperature,
@@ -124,6 +127,9 @@ const TimeScheduleDetailPage = () => {
124
127
  setMoods(res.data)
125
128
  if (props.mode === 'add') state.scene = getDpByScene(res.data[0])
126
129
  }
130
+ state.moodLoading = false
131
+ }).catch(() => {
132
+ state.moodLoading = false
127
133
  })
128
134
  }
129
135
  }, [])
@@ -680,7 +686,10 @@ const TimeScheduleDetailPage = () => {
680
686
  isSupportMode={props.isSupportUVC}
681
687
  />}
682
688
  </> :
683
- <FlatList
689
+ ( state.moodLoading ?
690
+ <LoadingView />
691
+ :
692
+ <FlatList
684
693
  data={cloneDeep(moods)}
685
694
  renderItem={({ item }) => {
686
695
  return (
@@ -702,6 +711,7 @@ const TimeScheduleDetailPage = () => {
702
711
  />
703
712
  </View>)}
704
713
  keyExtractor={item => `${item.id}`} />
714
+ )
705
715
  }
706
716
  <Spacer height={cx(20)} />
707
717
  <Text style={[styles.itemTitle, styles.cardContainer]}>{I18n.getLang('timeschedule_add_schedule_subheadline4_text')}</Text>