@ledvance/ui-biz-bundle 1.1.23 → 1.1.25

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/ui-biz-bundle",
5
5
  "pid": [],
6
6
  "uiid": "",
7
- "version": "1.1.23",
7
+ "version": "1.1.25",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
10
  "@ledvance/base": "^1.x",
@@ -3,7 +3,7 @@ import { FlagPageProps } from "./FlagPage";
3
3
  import { SceneNodeTransitionMode } from "@ledvance/ui-biz-bundle/src/modules/scene/SceneInfo";
4
4
  import { ColorUtils, WORK_MODE, nToHS, parseJSON, toFixed } from "@tuya/tuya-panel-lamp-sdk/lib/utils";
5
5
  import { cloneDeep } from "lodash";
6
- import { FlagItemInfo, FlagUiInfo, defFlagList } from "./FlagInfo";
6
+ import { FlagItemInfo, FlagUiInfo, defFlagList, def2FlagList, def3FlagList } from "./FlagInfo";
7
7
  import { hex2Int } from "@ledvance/base/src/utils/common";
8
8
  import { spliceByStep } from "@ledvance/base/src/utils/common";
9
9
  import { useMemo, useState } from "react";
@@ -201,8 +201,11 @@ export function dp2Obj(dp: string, option?: FlagOption): FlagItemInfo | undefine
201
201
 
202
202
  }
203
203
 
204
-
205
- export async function getRemoteFlag(devId: string) {
204
+ interface defFlagOption {
205
+ isDef2?: boolean
206
+ isDef3?: boolean
207
+ }
208
+ export async function getRemoteFlag(devId: string, defFlag?: defFlagOption) {
206
209
  const res = await NativeApi.getJson(devId, featureId)
207
210
  const isNormalData = Array.isArray(parseJSON(res?.data))
208
211
  if (res.success && isNormalData) {
@@ -212,11 +215,12 @@ export async function getRemoteFlag(devId: string) {
212
215
  }
213
216
  } else {
214
217
  if (res.msg?.includes('资源未找到') || !isNormalData) {
215
- const res = await NativeApi.putJson(devId, featureId, JSON.stringify(defFlagList))
218
+ const flags = defFlag?.isDef2 ? def2FlagList : defFlag?.isDef3 ? def3FlagList : defFlagList
219
+ const res = await NativeApi.putJson(devId, featureId, JSON.stringify(flags))
216
220
  if (res.success) {
217
221
  return {
218
222
  success: true,
219
- data: cloneDeep(defFlagList)
223
+ data: cloneDeep(flags)
220
224
  }
221
225
  }
222
226
  return { success: false }
@@ -1,5 +1,5 @@
1
1
  import I18n from "@ledvance/base/src/i18n";
2
- import { SceneNodeTransitionMode } from "@ledvance/ui-biz-bundle/src/modules/scene/SceneInfo";
2
+ import { SceneNodeTransitionMode } from "../scene/SceneInfo";
3
3
 
4
4
  type HSV = {
5
5
  h: number
@@ -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,7 +5,7 @@ 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";
@@ -18,6 +18,7 @@ import { SceneNodeTransitionMode } from "@ledvance/ui-biz-bundle/src/modules/sce
18
18
  import { Result } from "@ledvance/base/src/models/modules/Result";
19
19
  import { useDps } from "@ledvance/base/src/models/modules/NativePropsSlice";
20
20
  import { ColorUtils, WORK_MODE } from "@tuya/tuya-panel-lamp-sdk/lib/utils";
21
+ import TextField from "@ledvance/base/src/components/TextField";
21
22
  const cx = Utils.RatioUtils.convertX
22
23
 
23
24
  export interface FlagPageProps {
@@ -55,7 +56,8 @@ const FlagPage = () => {
55
56
  const state = useReactive({
56
57
  loading: true,
57
58
  flags: cloneDeep(flags) as FlagUiInfo[],
58
- moods: params.isStripLight ? [] : cloneDeep(moods)
59
+ moods: params.isStripLight ? [] : cloneDeep(moods),
60
+ searchText: ''
59
61
  })
60
62
  const flagId = useMemo(() =>{
61
63
  if(flagState.colors !== undefined){
@@ -73,19 +75,19 @@ const FlagPage = () => {
73
75
 
74
76
 
75
77
  useEffect(() => {
76
- if(!devId) return
78
+ if(!devInfo.devId) return
77
79
  if(!flags?.length){
78
80
  getRemoteFlagInfo().then()
79
81
  }
80
82
  if(params.getRemoteMoodList && !moods?.length){
81
- params.getRemoteMoodList(devId).then(res =>{
83
+ params.getRemoteMoodList(devInfo.devId).then(res =>{
82
84
  if(res.success && Array.isArray(res.data)){
83
85
  state.moods = res.data
84
86
  setMoods(cloneDeep(res.data))
85
87
  }
86
88
  })
87
89
  }
88
- }, [devId])
90
+ }, [devInfo.devId])
89
91
 
90
92
  useUpdateEffect(() =>{
91
93
  state.moods = params.isStripLight ? [] : cloneDeep(moods)
@@ -95,8 +97,14 @@ const FlagPage = () => {
95
97
  state.flags = cloneDeep(flags)
96
98
  }, [JSON.stringify(flags)])
97
99
 
100
+ useUpdateEffect(() =>{
101
+ state.flags = state.searchText !== '' ? cloneDeep(flags).filter(flag => flag.name.includes(state.searchText)) : cloneDeep(flags)
102
+ }, [state.searchText, flags])
103
+
98
104
  const getRemoteFlagInfo = async () => {
99
- const res = await getRemoteFlag(devId)
105
+ const isDef2 = def2Pids.includes(devInfo.productId)
106
+ const isDef3 = def3Pids.includes(devInfo.productId)
107
+ const res = await getRemoteFlag(devInfo.devId, {isDef2, isDef3})
100
108
  if (res.success) {
101
109
  let cloneFlag: FlagUiInfo[] = cloneDeep(res.data) || []
102
110
  if(!params.drawToolLight){
@@ -191,6 +199,14 @@ const FlagPage = () => {
191
199
  }
192
200
  }}
193
201
  >
202
+ <TextField
203
+ value={state.searchText}
204
+ onChangeText={text => {
205
+ state.searchText = text
206
+ }}
207
+ placeholder={I18n.getLang('country_selection_textfield_headline_search')}
208
+ style={{ marginHorizontal: cx(24) }}
209
+ />
194
210
  <FlatList
195
211
  data={state.flags}
196
212
  renderItem={({ item }) => <FlagItem