@ledvance/base 1.2.24 → 1.2.26
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 +1 -1
- package/src/composeLayout.tsx +9 -3
- package/src/i18n/strings.ts +87 -29
- package/src/models/modules/NativePropsSlice.tsx +16 -4
- package/src/utils/common.ts +46 -9
package/package.json
CHANGED
package/src/composeLayout.tsx
CHANGED
|
@@ -4,13 +4,14 @@ import { Provider } from 'react-redux'
|
|
|
4
4
|
import { DevInfo, DpValue, Theme, TYSdk } from 'tuya-panel-kit'
|
|
5
5
|
import { actions, store } from './models'
|
|
6
6
|
import { addListener, removeListener } from 'api/nativeEventEmitter'
|
|
7
|
-
import { NativeApi } from 'api/native'
|
|
7
|
+
import { getSystemTimeFormat, NativeApi } from 'api/native'
|
|
8
8
|
import {
|
|
9
9
|
DeviceInfo,
|
|
10
10
|
NativeProps,
|
|
11
11
|
setGroupDevices,
|
|
12
12
|
setGroupNativeProps,
|
|
13
13
|
setNativeProps,
|
|
14
|
+
setSystemTimeFormat,
|
|
14
15
|
UAGroupInfo,
|
|
15
16
|
} from './models/modules/NativePropsSlice'
|
|
16
17
|
import { DpSchema, GlobalParams } from './models/GlobalParams'
|
|
@@ -117,6 +118,9 @@ const composeLayout = (component: React.ComponentType) => {
|
|
|
117
118
|
this.initReduxGroupNativeProps(props.uaGroupInfo)
|
|
118
119
|
this.initGroupDevices(props.uaGroupInfo?.tyGroupId)
|
|
119
120
|
}
|
|
121
|
+
getSystemTimeFormat().then(time => {
|
|
122
|
+
dispatch(setSystemTimeFormat(time === 24))
|
|
123
|
+
})
|
|
120
124
|
}
|
|
121
125
|
|
|
122
126
|
initReduxDeviceNativeProps(ldvDevInfo: LdvDevInfo) {
|
|
@@ -138,7 +142,8 @@ const composeLayout = (component: React.ComponentType) => {
|
|
|
138
142
|
},
|
|
139
143
|
familyName: ldvDevInfo.familyName,
|
|
140
144
|
role: ldvDevInfo.role,
|
|
141
|
-
moods: []
|
|
145
|
+
moods: [],
|
|
146
|
+
is24HourClock: true
|
|
142
147
|
}
|
|
143
148
|
NativeApi.showObj(nativeProps)
|
|
144
149
|
console.log('Redux 初始数据:', JSON.stringify(nativeProps))
|
|
@@ -167,7 +172,8 @@ const composeLayout = (component: React.ComponentType) => {
|
|
|
167
172
|
},
|
|
168
173
|
familyName: uaGroupInfo.familyName,
|
|
169
174
|
role: uaGroupInfo.role,
|
|
170
|
-
moods: []
|
|
175
|
+
moods: [],
|
|
176
|
+
is24HourClock: true
|
|
171
177
|
}
|
|
172
178
|
NativeApi.showObj(nativeProps)
|
|
173
179
|
console.log('Redux 初始数据:', JSON.stringify(nativeProps))
|
package/src/i18n/strings.ts
CHANGED
|
@@ -547,7 +547,9 @@ export default {
|
|
|
547
547
|
striplight_adaptbutton: "Adaptar",
|
|
548
548
|
striplight_lengthtitle: "Longitud de la tira de luz",
|
|
549
549
|
striplight_actuallength: "Longitud real",
|
|
550
|
-
add_sleepschedule_one_source_subheadline4_text: "Resumen"
|
|
550
|
+
add_sleepschedule_one_source_subheadline4_text: "Resumen",
|
|
551
|
+
manage_user_calendar_label_am: "AM",
|
|
552
|
+
manage_user_calendar_label_pm: "PM"
|
|
551
553
|
},
|
|
552
554
|
ar: {
|
|
553
555
|
add_new_dynamic_mood_color_changing_mode_value: "التدرج",
|
|
@@ -1097,7 +1099,9 @@ export default {
|
|
|
1097
1099
|
striplight_adaptbutton: "تكيف",
|
|
1098
1100
|
striplight_lengthtitle: "طول شريط الضوء",
|
|
1099
1101
|
striplight_actuallength: "الطول الفعلي",
|
|
1100
|
-
add_sleepschedule_one_source_subheadline4_text: "ملخص"
|
|
1102
|
+
add_sleepschedule_one_source_subheadline4_text: "ملخص",
|
|
1103
|
+
manage_user_calendar_label_am: "صباحًا",
|
|
1104
|
+
manage_user_calendar_label_pm: "مساء"
|
|
1101
1105
|
},
|
|
1102
1106
|
cs: {
|
|
1103
1107
|
add_new_dynamic_mood_color_changing_mode_value: "Gradient",
|
|
@@ -1647,7 +1651,9 @@ export default {
|
|
|
1647
1651
|
striplight_adaptbutton: "Přizpůsobit",
|
|
1648
1652
|
striplight_lengthtitle: "Délka světelného pásu",
|
|
1649
1653
|
striplight_actuallength: "Skutečná délka",
|
|
1650
|
-
add_sleepschedule_one_source_subheadline4_text: "SHRNUTÍ"
|
|
1654
|
+
add_sleepschedule_one_source_subheadline4_text: "SHRNUTÍ",
|
|
1655
|
+
manage_user_calendar_label_am: "dopoledne",
|
|
1656
|
+
manage_user_calendar_label_pm: "odpoledne"
|
|
1651
1657
|
},
|
|
1652
1658
|
en: {
|
|
1653
1659
|
add_new_dynamic_mood_color_changing_mode_value: "Gradient",
|
|
@@ -2197,7 +2203,9 @@ export default {
|
|
|
2197
2203
|
striplight_adaptbutton: "Adapt",
|
|
2198
2204
|
striplight_lengthtitle: "Strip Light length",
|
|
2199
2205
|
striplight_actuallength: "Actual length",
|
|
2200
|
-
add_sleepschedule_one_source_subheadline4_text: "SUMMARY"
|
|
2206
|
+
add_sleepschedule_one_source_subheadline4_text: "SUMMARY",
|
|
2207
|
+
manage_user_calendar_label_am: "AM",
|
|
2208
|
+
manage_user_calendar_label_pm: "PM"
|
|
2201
2209
|
},
|
|
2202
2210
|
bg: {
|
|
2203
2211
|
add_new_dynamic_mood_color_changing_mode_value: "Градиент",
|
|
@@ -2747,7 +2755,9 @@ export default {
|
|
|
2747
2755
|
striplight_adaptbutton: "Адаптиране",
|
|
2748
2756
|
striplight_lengthtitle: "Лента Светла дължина",
|
|
2749
2757
|
striplight_actuallength: "Действителна дължина",
|
|
2750
|
-
add_sleepschedule_one_source_subheadline4_text: "ОБОБЩЕНИЕ"
|
|
2758
|
+
add_sleepschedule_one_source_subheadline4_text: "ОБОБЩЕНИЕ",
|
|
2759
|
+
manage_user_calendar_label_am: "АМ",
|
|
2760
|
+
manage_user_calendar_label_pm: "PM"
|
|
2751
2761
|
},
|
|
2752
2762
|
da: {
|
|
2753
2763
|
add_new_dynamic_mood_color_changing_mode_value: "Gradvist",
|
|
@@ -3297,7 +3307,9 @@ export default {
|
|
|
3297
3307
|
striplight_adaptbutton: "Tilpas",
|
|
3298
3308
|
striplight_lengthtitle: "Strip Light længde",
|
|
3299
3309
|
striplight_actuallength: "Faktisk længde",
|
|
3300
|
-
add_sleepschedule_one_source_subheadline4_text: "OVERSIGT"
|
|
3310
|
+
add_sleepschedule_one_source_subheadline4_text: "OVERSIGT",
|
|
3311
|
+
manage_user_calendar_label_am: "Om formiddagen",
|
|
3312
|
+
manage_user_calendar_label_pm: "om eftermiddagen"
|
|
3301
3313
|
},
|
|
3302
3314
|
de: {
|
|
3303
3315
|
add_new_dynamic_mood_color_changing_mode_value: "Fließend",
|
|
@@ -3847,7 +3859,9 @@ export default {
|
|
|
3847
3859
|
striplight_adaptbutton: "Anpassen",
|
|
3848
3860
|
striplight_lengthtitle: "Länge des Lichtstreifens",
|
|
3849
3861
|
striplight_actuallength: "Tatsächliche Länge",
|
|
3850
|
-
add_sleepschedule_one_source_subheadline4_text: "Zusammenfassung"
|
|
3862
|
+
add_sleepschedule_one_source_subheadline4_text: "Zusammenfassung",
|
|
3863
|
+
manage_user_calendar_label_am: "vorm.",
|
|
3864
|
+
manage_user_calendar_label_pm: "nachm."
|
|
3851
3865
|
},
|
|
3852
3866
|
el: {
|
|
3853
3867
|
add_new_dynamic_mood_color_changing_mode_value: "Διαβάθμιση",
|
|
@@ -4397,7 +4411,9 @@ export default {
|
|
|
4397
4411
|
striplight_adaptbutton: "Προσαρμογή",
|
|
4398
4412
|
striplight_lengthtitle: "Μήκος strip Light",
|
|
4399
4413
|
striplight_actuallength: "Πραγματικό μήκος",
|
|
4400
|
-
add_sleepschedule_one_source_subheadline4_text: "ΣΥΝΟΨΗ"
|
|
4414
|
+
add_sleepschedule_one_source_subheadline4_text: "ΣΥΝΟΨΗ",
|
|
4415
|
+
manage_user_calendar_label_am: "ΠΜ",
|
|
4416
|
+
manage_user_calendar_label_pm: "ΜΜ"
|
|
4401
4417
|
},
|
|
4402
4418
|
es: {
|
|
4403
4419
|
add_new_dynamic_mood_color_changing_mode_value: "Gradiente",
|
|
@@ -4947,7 +4963,9 @@ export default {
|
|
|
4947
4963
|
striplight_adaptbutton: "Adaptar",
|
|
4948
4964
|
striplight_lengthtitle: "Longitud de la tira de luz",
|
|
4949
4965
|
striplight_actuallength: "Longitud real",
|
|
4950
|
-
add_sleepschedule_one_source_subheadline4_text: "Resumen"
|
|
4966
|
+
add_sleepschedule_one_source_subheadline4_text: "Resumen",
|
|
4967
|
+
manage_user_calendar_label_am: "AM",
|
|
4968
|
+
manage_user_calendar_label_pm: "PM"
|
|
4951
4969
|
},
|
|
4952
4970
|
et: {
|
|
4953
4971
|
add_new_dynamic_mood_color_changing_mode_value: "Muutmisaste",
|
|
@@ -5497,7 +5515,9 @@ export default {
|
|
|
5497
5515
|
striplight_adaptbutton: "Kohaneda",
|
|
5498
5516
|
striplight_lengthtitle: "Riba valguse pikkus",
|
|
5499
5517
|
striplight_actuallength: "Tegelik pikkus",
|
|
5500
|
-
add_sleepschedule_one_source_subheadline4_text: "KOKKUVÕTE"
|
|
5518
|
+
add_sleepschedule_one_source_subheadline4_text: "KOKKUVÕTE",
|
|
5519
|
+
manage_user_calendar_label_am: "enne lõunat",
|
|
5520
|
+
manage_user_calendar_label_pm: "pärast lõunat"
|
|
5501
5521
|
},
|
|
5502
5522
|
fi: {
|
|
5503
5523
|
add_new_dynamic_mood_color_changing_mode_value: "Liukuva",
|
|
@@ -6047,7 +6067,9 @@ export default {
|
|
|
6047
6067
|
striplight_adaptbutton: "Sopeutua",
|
|
6048
6068
|
striplight_lengthtitle: "Nauhan valon pituus",
|
|
6049
6069
|
striplight_actuallength: "Todellinen pituus",
|
|
6050
|
-
add_sleepschedule_one_source_subheadline4_text: "YHTEENVETO"
|
|
6070
|
+
add_sleepschedule_one_source_subheadline4_text: "YHTEENVETO",
|
|
6071
|
+
manage_user_calendar_label_am: "AAMUPÄIVÄ",
|
|
6072
|
+
manage_user_calendar_label_pm: "ILTAPÄIVÄ"
|
|
6051
6073
|
},
|
|
6052
6074
|
fr: {
|
|
6053
6075
|
add_new_dynamic_mood_color_changing_mode_value: "Fluide",
|
|
@@ -6597,7 +6619,9 @@ export default {
|
|
|
6597
6619
|
striplight_adaptbutton: "Adapter",
|
|
6598
6620
|
striplight_lengthtitle: "Longueur de la bande lumineuse",
|
|
6599
6621
|
striplight_actuallength: "Longueur réelle",
|
|
6600
|
-
add_sleepschedule_one_source_subheadline4_text: "Récapitulatif"
|
|
6622
|
+
add_sleepschedule_one_source_subheadline4_text: "Récapitulatif",
|
|
6623
|
+
manage_user_calendar_label_am: "AM",
|
|
6624
|
+
manage_user_calendar_label_pm: "PM"
|
|
6601
6625
|
},
|
|
6602
6626
|
hr: {
|
|
6603
6627
|
add_new_dynamic_mood_color_changing_mode_value: "Prijelaz",
|
|
@@ -7147,7 +7171,9 @@ export default {
|
|
|
7147
7171
|
striplight_adaptbutton: "Prilagoditi",
|
|
7148
7172
|
striplight_lengthtitle: "Duljina svjetla trake",
|
|
7149
7173
|
striplight_actuallength: "Stvarna duljina",
|
|
7150
|
-
add_sleepschedule_one_source_subheadline4_text: "SAŽETAK"
|
|
7174
|
+
add_sleepschedule_one_source_subheadline4_text: "SAŽETAK",
|
|
7175
|
+
manage_user_calendar_label_am: "AM",
|
|
7176
|
+
manage_user_calendar_label_pm: "PM"
|
|
7151
7177
|
},
|
|
7152
7178
|
hu: {
|
|
7153
7179
|
add_new_dynamic_mood_color_changing_mode_value: "Átmenet",
|
|
@@ -7697,7 +7723,9 @@ export default {
|
|
|
7697
7723
|
striplight_adaptbutton: "Alkalmazkodás",
|
|
7698
7724
|
striplight_lengthtitle: "Szalagfény hossza",
|
|
7699
7725
|
striplight_actuallength: "Valós hossz",
|
|
7700
|
-
add_sleepschedule_one_source_subheadline4_text: "ÖSSZEGZÉS"
|
|
7726
|
+
add_sleepschedule_one_source_subheadline4_text: "ÖSSZEGZÉS",
|
|
7727
|
+
manage_user_calendar_label_am: "DE.",
|
|
7728
|
+
manage_user_calendar_label_pm: "DU."
|
|
7701
7729
|
},
|
|
7702
7730
|
it: {
|
|
7703
7731
|
add_new_dynamic_mood_color_changing_mode_value: "Fluido",
|
|
@@ -8247,7 +8275,9 @@ export default {
|
|
|
8247
8275
|
striplight_adaptbutton: "Adattarsi",
|
|
8248
8276
|
striplight_lengthtitle: "Lunghezza della striscia luminosa",
|
|
8249
8277
|
striplight_actuallength: "Lunghezza effettiva",
|
|
8250
|
-
add_sleepschedule_one_source_subheadline4_text: "Riepilogo"
|
|
8278
|
+
add_sleepschedule_one_source_subheadline4_text: "Riepilogo",
|
|
8279
|
+
manage_user_calendar_label_am: "AM",
|
|
8280
|
+
manage_user_calendar_label_pm: "PM"
|
|
8251
8281
|
},
|
|
8252
8282
|
ko: {
|
|
8253
8283
|
add_new_dynamic_mood_color_changing_mode_value: "그래디언트",
|
|
@@ -8797,7 +8827,9 @@ export default {
|
|
|
8797
8827
|
striplight_adaptbutton: "적응",
|
|
8798
8828
|
striplight_lengthtitle: "스트립 라이트 길이",
|
|
8799
8829
|
striplight_actuallength: "실제 길이",
|
|
8800
|
-
add_sleepschedule_one_source_subheadline4_text: "개요"
|
|
8830
|
+
add_sleepschedule_one_source_subheadline4_text: "개요",
|
|
8831
|
+
manage_user_calendar_label_am: "오전",
|
|
8832
|
+
manage_user_calendar_label_pm: "오후"
|
|
8801
8833
|
},
|
|
8802
8834
|
lt: {
|
|
8803
8835
|
add_new_dynamic_mood_color_changing_mode_value: "Gradientas",
|
|
@@ -9347,7 +9379,9 @@ export default {
|
|
|
9347
9379
|
striplight_adaptbutton: "Prisitaikyti",
|
|
9348
9380
|
striplight_lengthtitle: "Juostelė Šviesos ilgis",
|
|
9349
9381
|
striplight_actuallength: "Tikrasis ilgis",
|
|
9350
|
-
add_sleepschedule_one_source_subheadline4_text: "SANTRAUKA"
|
|
9382
|
+
add_sleepschedule_one_source_subheadline4_text: "SANTRAUKA",
|
|
9383
|
+
manage_user_calendar_label_am: "Priešpiet",
|
|
9384
|
+
manage_user_calendar_label_pm: "Popiet"
|
|
9351
9385
|
},
|
|
9352
9386
|
lv: {
|
|
9353
9387
|
add_new_dynamic_mood_color_changing_mode_value: "Gradients",
|
|
@@ -9897,7 +9931,9 @@ export default {
|
|
|
9897
9931
|
striplight_adaptbutton: "Pielāgot",
|
|
9898
9932
|
striplight_lengthtitle: "Sloksne Gaismas garums",
|
|
9899
9933
|
striplight_actuallength: "Faktiskais garums",
|
|
9900
|
-
add_sleepschedule_one_source_subheadline4_text: "KOPSAVILKUMS"
|
|
9934
|
+
add_sleepschedule_one_source_subheadline4_text: "KOPSAVILKUMS",
|
|
9935
|
+
manage_user_calendar_label_am: "priekšpusdienā",
|
|
9936
|
+
manage_user_calendar_label_pm: "pēcpusdienā"
|
|
9901
9937
|
},
|
|
9902
9938
|
nb: {
|
|
9903
9939
|
add_new_dynamic_mood_color_changing_mode_value: "Gradient",
|
|
@@ -10447,7 +10483,9 @@ export default {
|
|
|
10447
10483
|
striplight_adaptbutton: "Tilpass",
|
|
10448
10484
|
striplight_lengthtitle: "Stripelys lengde",
|
|
10449
10485
|
striplight_actuallength: "Faktisk lengde",
|
|
10450
|
-
add_sleepschedule_one_source_subheadline4_text: "SAMMENDRAG"
|
|
10486
|
+
add_sleepschedule_one_source_subheadline4_text: "SAMMENDRAG",
|
|
10487
|
+
manage_user_calendar_label_am: "FM",
|
|
10488
|
+
manage_user_calendar_label_pm: "EM"
|
|
10451
10489
|
},
|
|
10452
10490
|
nl: {
|
|
10453
10491
|
add_new_dynamic_mood_color_changing_mode_value: "Verloop",
|
|
@@ -10997,7 +11035,9 @@ export default {
|
|
|
10997
11035
|
striplight_adaptbutton: "Aanpassen",
|
|
10998
11036
|
striplight_lengthtitle: "Lengte van de striplamp",
|
|
10999
11037
|
striplight_actuallength: "Werkelijke lengte",
|
|
11000
|
-
add_sleepschedule_one_source_subheadline4_text: "SAMENVATTING"
|
|
11038
|
+
add_sleepschedule_one_source_subheadline4_text: "SAMENVATTING",
|
|
11039
|
+
manage_user_calendar_label_am: "AM",
|
|
11040
|
+
manage_user_calendar_label_pm: "PM"
|
|
11001
11041
|
},
|
|
11002
11042
|
pl: {
|
|
11003
11043
|
add_new_dynamic_mood_color_changing_mode_value: "Gradient",
|
|
@@ -11547,7 +11587,9 @@ export default {
|
|
|
11547
11587
|
striplight_adaptbutton: "Dostosuj",
|
|
11548
11588
|
striplight_lengthtitle: "Długość paska światła",
|
|
11549
11589
|
striplight_actuallength: "Rzeczywista długość",
|
|
11550
|
-
add_sleepschedule_one_source_subheadline4_text: "PODSUMOWANIE"
|
|
11590
|
+
add_sleepschedule_one_source_subheadline4_text: "PODSUMOWANIE",
|
|
11591
|
+
manage_user_calendar_label_am: "Przed południem",
|
|
11592
|
+
manage_user_calendar_label_pm: "Po południu"
|
|
11551
11593
|
},
|
|
11552
11594
|
'pt-BR': {
|
|
11553
11595
|
add_new_dynamic_mood_color_changing_mode_value: "Gradiente",
|
|
@@ -12097,7 +12139,9 @@ export default {
|
|
|
12097
12139
|
striplight_adaptbutton: "Adaptar",
|
|
12098
12140
|
striplight_lengthtitle: "Comprimento da luz de tira",
|
|
12099
12141
|
striplight_actuallength: "Comprimento real",
|
|
12100
|
-
add_sleepschedule_one_source_subheadline4_text: "Sumário"
|
|
12142
|
+
add_sleepschedule_one_source_subheadline4_text: "Sumário",
|
|
12143
|
+
manage_user_calendar_label_am: "a.m.",
|
|
12144
|
+
manage_user_calendar_label_pm: "PM"
|
|
12101
12145
|
},
|
|
12102
12146
|
'pt_BR': {
|
|
12103
12147
|
add_new_dynamic_mood_color_changing_mode_value: "Gradiente",
|
|
@@ -12647,7 +12691,9 @@ export default {
|
|
|
12647
12691
|
striplight_adaptbutton: "Adaptar",
|
|
12648
12692
|
striplight_lengthtitle: "Comprimento da luz de tira",
|
|
12649
12693
|
striplight_actuallength: "Comprimento real",
|
|
12650
|
-
add_sleepschedule_one_source_subheadline4_text: "Sumário"
|
|
12694
|
+
add_sleepschedule_one_source_subheadline4_text: "Sumário",
|
|
12695
|
+
manage_user_calendar_label_am: "a.m.",
|
|
12696
|
+
manage_user_calendar_label_pm: "PM"
|
|
12651
12697
|
},
|
|
12652
12698
|
ro: {
|
|
12653
12699
|
add_new_dynamic_mood_color_changing_mode_value: "Gradient",
|
|
@@ -13197,7 +13243,9 @@ export default {
|
|
|
13197
13243
|
striplight_adaptbutton: "Adaptare",
|
|
13198
13244
|
striplight_lengthtitle: "Lungimea luminii benzii",
|
|
13199
13245
|
striplight_actuallength: "Lungimea reală",
|
|
13200
|
-
add_sleepschedule_one_source_subheadline4_text: "Rezumat"
|
|
13246
|
+
add_sleepschedule_one_source_subheadline4_text: "Rezumat",
|
|
13247
|
+
manage_user_calendar_label_am: "AM",
|
|
13248
|
+
manage_user_calendar_label_pm: "PM"
|
|
13201
13249
|
},
|
|
13202
13250
|
ru: {
|
|
13203
13251
|
add_new_dynamic_mood_color_changing_mode_value: "Градиент",
|
|
@@ -13747,7 +13795,9 @@ export default {
|
|
|
13747
13795
|
striplight_adaptbutton: "Адаптировать",
|
|
13748
13796
|
striplight_lengthtitle: "Длина полосы света",
|
|
13749
13797
|
striplight_actuallength: "Фактическая длина",
|
|
13750
|
-
add_sleepschedule_one_source_subheadline4_text: "Краткая информация"
|
|
13798
|
+
add_sleepschedule_one_source_subheadline4_text: "Краткая информация",
|
|
13799
|
+
manage_user_calendar_label_am: "до полудня",
|
|
13800
|
+
manage_user_calendar_label_pm: "После полудня"
|
|
13751
13801
|
},
|
|
13752
13802
|
sk: {
|
|
13753
13803
|
add_new_dynamic_mood_color_changing_mode_value: "Prechod",
|
|
@@ -14297,7 +14347,9 @@ export default {
|
|
|
14297
14347
|
striplight_adaptbutton: "Prispôsobiť",
|
|
14298
14348
|
striplight_lengthtitle: "Dĺžka pásu svetla",
|
|
14299
14349
|
striplight_actuallength: "Skutočná dĺžka",
|
|
14300
|
-
add_sleepschedule_one_source_subheadline4_text: "ZHRNUTIE"
|
|
14350
|
+
add_sleepschedule_one_source_subheadline4_text: "ZHRNUTIE",
|
|
14351
|
+
manage_user_calendar_label_am: "Dopoludnie",
|
|
14352
|
+
manage_user_calendar_label_pm: "Popoludnie"
|
|
14301
14353
|
},
|
|
14302
14354
|
sv: {
|
|
14303
14355
|
add_new_dynamic_mood_color_changing_mode_value: "Toning",
|
|
@@ -14847,7 +14899,9 @@ export default {
|
|
|
14847
14899
|
striplight_adaptbutton: "Anpassa",
|
|
14848
14900
|
striplight_lengthtitle: "Strip Ljuslängd",
|
|
14849
14901
|
striplight_actuallength: "Faktisk längd",
|
|
14850
|
-
add_sleepschedule_one_source_subheadline4_text: "SAMMANFATTNING"
|
|
14902
|
+
add_sleepschedule_one_source_subheadline4_text: "SAMMANFATTNING",
|
|
14903
|
+
manage_user_calendar_label_am: "FM",
|
|
14904
|
+
manage_user_calendar_label_pm: "EM"
|
|
14851
14905
|
},
|
|
14852
14906
|
tr: {
|
|
14853
14907
|
add_new_dynamic_mood_color_changing_mode_value: "Gradyan",
|
|
@@ -15397,7 +15451,9 @@ export default {
|
|
|
15397
15451
|
striplight_adaptbutton: "Uyarlamak",
|
|
15398
15452
|
striplight_lengthtitle: "Şerit Işık uzunluğu",
|
|
15399
15453
|
striplight_actuallength: "Gerçek uzunluk",
|
|
15400
|
-
add_sleepschedule_one_source_subheadline4_text: "ÖZET"
|
|
15454
|
+
add_sleepschedule_one_source_subheadline4_text: "ÖZET",
|
|
15455
|
+
manage_user_calendar_label_am: "ÖÖ",
|
|
15456
|
+
manage_user_calendar_label_pm: "ÖĞLEDEN SONRA"
|
|
15401
15457
|
},
|
|
15402
15458
|
uk: {
|
|
15403
15459
|
add_new_dynamic_mood_color_changing_mode_value: "Градієнт",
|
|
@@ -15947,6 +16003,8 @@ export default {
|
|
|
15947
16003
|
striplight_adaptbutton: "Адаптувати",
|
|
15948
16004
|
striplight_lengthtitle: "Довжина світлової смуги",
|
|
15949
16005
|
striplight_actuallength: "Фактична довжина",
|
|
15950
|
-
add_sleepschedule_one_source_subheadline4_text: "ПІДСУМОК"
|
|
16006
|
+
add_sleepschedule_one_source_subheadline4_text: "ПІДСУМОК",
|
|
16007
|
+
manage_user_calendar_label_am: "АМ",
|
|
16008
|
+
manage_user_calendar_label_pm: "PM"
|
|
15951
16009
|
}
|
|
15952
16010
|
}
|
|
@@ -8,6 +8,7 @@ import { useDispatch } from 'react-redux'
|
|
|
8
8
|
import { GlobalParams } from '../GlobalParams'
|
|
9
9
|
import { isNumber, snakeCase } from 'lodash'
|
|
10
10
|
import { PropertyValueTypes } from '../../utils/TypeUtils'
|
|
11
|
+
import { DeviceInfo as GroupDeviceInfo } from '../../api/native'
|
|
11
12
|
|
|
12
13
|
export interface NativeProps {
|
|
13
14
|
familyName: string
|
|
@@ -17,6 +18,7 @@ export interface NativeProps {
|
|
|
17
18
|
timeSchedule?: boolean
|
|
18
19
|
energieverbrauch?: object
|
|
19
20
|
moods: any[]
|
|
21
|
+
is24HourClock: boolean
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
export interface DeviceInfo {
|
|
@@ -30,7 +32,7 @@ export interface UAGroupInfo {
|
|
|
30
32
|
pId: string
|
|
31
33
|
dps: any
|
|
32
34
|
config: any
|
|
33
|
-
groupDevices:
|
|
35
|
+
groupDevices: GroupDeviceInfo[]
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
const initialState: NativeProps = {
|
|
@@ -51,6 +53,7 @@ const initialState: NativeProps = {
|
|
|
51
53
|
timeSchedule: false,
|
|
52
54
|
energieverbrauch: {},
|
|
53
55
|
moods: [],
|
|
56
|
+
is24HourClock: true
|
|
54
57
|
}
|
|
55
58
|
|
|
56
59
|
// energy generation
|
|
@@ -114,6 +117,9 @@ const nativePropsSlice = createSlice({
|
|
|
114
117
|
setGroupDevices(state, action: PayloadAction<any>) {
|
|
115
118
|
state.uaGroupInfo.groupDevices = action.payload
|
|
116
119
|
},
|
|
120
|
+
setSystemTimeFormat(state, action: PayloadAction<any>) {
|
|
121
|
+
state.is24HourClock = action.payload
|
|
122
|
+
}
|
|
117
123
|
},
|
|
118
124
|
})
|
|
119
125
|
|
|
@@ -224,15 +230,19 @@ const useMoods = (): [any[], (v: any[]) => void] => {
|
|
|
224
230
|
return [dps, setMoodsFn]
|
|
225
231
|
}
|
|
226
232
|
|
|
227
|
-
const useGroupDevices = (): [
|
|
233
|
+
const useGroupDevices = (): [GroupDeviceInfo[], (v: GroupDeviceInfo[]) => void] => {
|
|
228
234
|
const dps = useSelector(store => store.ldvModules.uaGroupInfo.groupDevices)
|
|
229
235
|
const dispatch = useDispatch()
|
|
230
|
-
const setGroupDevicesFn = (value:
|
|
236
|
+
const setGroupDevicesFn = (value: GroupDeviceInfo[]) => {
|
|
231
237
|
dispatch(setGroupDevices(value))
|
|
232
238
|
}
|
|
233
239
|
return [dps, setGroupDevicesFn]
|
|
234
240
|
}
|
|
235
241
|
|
|
242
|
+
const useSystemTimeFormate = (): boolean => {
|
|
243
|
+
return useSelector(store => store.ldvModules.is24HourClock)
|
|
244
|
+
}
|
|
245
|
+
|
|
236
246
|
const useEnergieverbrauch = () => {
|
|
237
247
|
const dps = useSelector(store => store.ldvModules.energieverbrauch)
|
|
238
248
|
const dispatch = useDispatch()
|
|
@@ -314,7 +324,7 @@ export function useFeatureHook<GC, T extends PropertyValueTypes<GC>>(
|
|
|
314
324
|
const extraConfig = getExtraConfig ? getExtraConfig(value) : undefined
|
|
315
325
|
return await setFH(value, dpValue, extraDps, extraConfig)
|
|
316
326
|
}, [setFH])
|
|
317
|
-
return [featureHook
|
|
327
|
+
return [featureHook || defValue, setFeatureHook]
|
|
318
328
|
}
|
|
319
329
|
|
|
320
330
|
export const useFanMaxSpeed = () => {
|
|
@@ -336,6 +346,7 @@ export const {
|
|
|
336
346
|
setTimeSchedule,
|
|
337
347
|
setMoods,
|
|
338
348
|
setGroupDevices,
|
|
349
|
+
setSystemTimeFormat,
|
|
339
350
|
setEnergieverbrauch,
|
|
340
351
|
} = nativePropsSlice.actions
|
|
341
352
|
|
|
@@ -353,5 +364,6 @@ export {
|
|
|
353
364
|
useTimeSchedule,
|
|
354
365
|
useMoods,
|
|
355
366
|
useGroupDevices,
|
|
367
|
+
useSystemTimeFormate,
|
|
356
368
|
useEnergieverbrauch,
|
|
357
369
|
}
|
package/src/utils/common.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {NativeModules, Platform} from 'react-native'
|
|
1
|
+
import { NativeModules, Platform } from 'react-native'
|
|
2
2
|
import I18n from '../i18n/index'
|
|
3
|
-
import {formatNumber, openDownloadFile} from 'api/native'
|
|
3
|
+
import { formatNumber, openDownloadFile } from 'api/native'
|
|
4
4
|
import dayjs from 'dayjs'
|
|
5
5
|
import RNFetchBlob from 'rn-fetch-blob'
|
|
6
|
-
import {isEqual} from 'lodash'
|
|
7
|
-
import {Dialog} from 'tuya-panel-kit'
|
|
6
|
+
import { isEqual } from 'lodash'
|
|
7
|
+
import { Dialog } from 'tuya-panel-kit'
|
|
8
8
|
|
|
9
9
|
const loopsText = [
|
|
10
10
|
I18n.getLang('timeschedule_add_schedule_weekday7_text'),
|
|
@@ -18,14 +18,14 @@ const loopsText = [
|
|
|
18
18
|
|
|
19
19
|
export const loopText = (loop, time = '') => {
|
|
20
20
|
let isToday = true
|
|
21
|
-
if(time){
|
|
21
|
+
if (time) {
|
|
22
22
|
const currentTime = dayjs()
|
|
23
23
|
const targetTime = dayjs().set('hour', parseInt(time.split(':')[0])).set('minute', parseInt(time.split(':')[1]));
|
|
24
24
|
const isBeforeCurrentTime = targetTime.isBefore(currentTime)
|
|
25
25
|
isToday = !isBeforeCurrentTime
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
const loopStrArray = loopsText.filter((_item, index) => Number(loop[index]) === 1)
|
|
28
|
+
return loopStrArray.length === 0 ? (I18n.getLang(isToday ? 'motion_detection_time_schedule_notifications_field_weekdays_text2' : 'motion_detection_time_schedule_notifications_field_weekdays_text3')) : loopStrArray.length === 7 ? I18n.getLang('motion_detection_time_schedule_notifications_field_weekdays_text4') : loopStrArray.join(' ')
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
const tommorrow = () => {
|
|
@@ -255,7 +255,7 @@ export function showDialog(props: DialogProps) {
|
|
|
255
255
|
confirmText: showConfirmText && (confirmText || I18n.getLang('conflict_dialog_save_item_fixedtimecycle_answer_yes_text')) || '',
|
|
256
256
|
subTitle,
|
|
257
257
|
onConfirm,
|
|
258
|
-
motionConfig:{
|
|
258
|
+
motionConfig: {
|
|
259
259
|
hideDuration: 0,
|
|
260
260
|
showDuration: 100
|
|
261
261
|
}
|
|
@@ -266,10 +266,47 @@ export function showDialog(props: DialogProps) {
|
|
|
266
266
|
confirmText: showConfirmText && (confirmText || I18n.getLang('conflict_dialog_save_item_fixedtimecycle_answer_yes_text')) || '',
|
|
267
267
|
subTitle,
|
|
268
268
|
onConfirm,
|
|
269
|
-
motionConfig:{
|
|
269
|
+
motionConfig: {
|
|
270
270
|
hideDuration: 0,
|
|
271
271
|
showDuration: 100
|
|
272
272
|
}
|
|
273
273
|
})
|
|
274
274
|
)
|
|
275
275
|
}
|
|
276
|
+
|
|
277
|
+
export function convertTo12HourFormat(time24: string) {
|
|
278
|
+
// 将字符串按照':'分割成小时和分钟
|
|
279
|
+
var timeParts = time24.split(':');
|
|
280
|
+
var hours = parseInt(timeParts[0]);
|
|
281
|
+
var minutes = parseInt(timeParts[1]);
|
|
282
|
+
|
|
283
|
+
// 检查小时是否大于等于12
|
|
284
|
+
var suffix = (hours >= 12) ? I18n.getLang('manage_user_calendar_label_pm') : I18n.getLang('manage_user_calendar_label_am');
|
|
285
|
+
|
|
286
|
+
// 如果小时大于12,将小时减去12
|
|
287
|
+
hours = (hours > 12) ? hours - 12 : hours;
|
|
288
|
+
|
|
289
|
+
// 如果小时为0,则表示为12小时制中的12点
|
|
290
|
+
hours = (hours == 0) ? 12 : hours;
|
|
291
|
+
|
|
292
|
+
// 返回转换后的时间字符串
|
|
293
|
+
return suffix + ' ' + hours + ':' + (minutes < 10 ? '0' : '') + minutes;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// 将分钟数转换为12小时制时间
|
|
297
|
+
export function convertMinutesTo12HourFormat(minutes: number) {
|
|
298
|
+
var hours = Math.floor(minutes / 60); // 获取小时数
|
|
299
|
+
var mins = minutes % 60; // 获取剩余分钟数
|
|
300
|
+
|
|
301
|
+
// 检查小时数是否大于12,并调整
|
|
302
|
+
if (hours > 12) {
|
|
303
|
+
hours -= 12;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
// 构造12小时制时间字符串
|
|
307
|
+
var suffix = (hours >= 12) ? I18n.getLang('manage_user_calendar_label_pm') : I18n.getLang('manage_user_calendar_label_am');
|
|
308
|
+
hours = (hours == 0) ? 12 : hours; // 处理午夜0点为12小时制的12点
|
|
309
|
+
var time12Hour = suffix + ' ' + hours + ':' + (mins < 10 ? '0' : '') + mins;
|
|
310
|
+
|
|
311
|
+
return time12Hour;
|
|
312
|
+
}
|