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

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.20",
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 }
@@ -105,7 +105,7 @@ export const defFlagList: FlagUiInfo[] = [
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,
@@ -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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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: 70,
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,
@@ -96,8 +98,17 @@ const FlagPage = () => {
96
98
  }
97
99
  }, [])
98
100
 
101
+ useUpdateEffect(() =>{
102
+ state.flags = state.searchText !== '' ? cloneDeep(flags).filter(flag => flag.name.includes(state.searchText)) : cloneDeep(flags)
103
+ }, [state.searchText, flags])
104
+
99
105
  const getRemoteFlagInfo = async () => {
100
- const res = await getRemoteFlag(uaGroupInfo.tyGroupId.toString())
106
+ const defNum = uaGroupInfo.groupDevices.filter(device => !(def2Pids.includes(device.tyPid) || def3Pids.includes(device.tyPid))).length
107
+ const def2Num = uaGroupInfo.groupDevices.filter(device => def2Pids.includes(device.tyPid)).length
108
+ const def3Num = uaGroupInfo.groupDevices.filter(device => def3Pids.includes(device.tyPid)).length
109
+ const isDef2 = def2Num > def3Num && def2Num > defNum
110
+ const isDef3 = def3Num > def2Num && def3Num > defNum
111
+ const res = await getRemoteFlag(uaGroupInfo.tyGroupId.toString(), {isDef2, isDef3})
101
112
  if (res.success) {
102
113
  let cloneFlag: FlagUiInfo[] = cloneDeep(res.data) || []
103
114
  if(!params.drawToolLight){
@@ -180,7 +191,6 @@ const FlagPage = () => {
180
191
  ...state.flags,
181
192
  ...state.moods
182
193
  ], 'id')
183
- console.log(useIds, '< --- useIds')
184
194
  const idRange = range(0, 256)
185
195
  const unuseId = last(difference(idRange, useIds))
186
196
  if (unuseId !== undefined) {
@@ -188,6 +198,13 @@ const FlagPage = () => {
188
198
  }
189
199
  }}
190
200
  >
201
+ <TextField
202
+ style={{marginHorizontal: cx(24)}}
203
+ value={state.searchText}
204
+ onChangeText={(v)=>{
205
+ state.searchText = v
206
+ }}
207
+ />
191
208
  <FlatList
192
209
  data={state.flags}
193
210
  renderItem={({ item }) => <FlagItem
@@ -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>