@ledvance/ui-biz-bundle 1.1.35 → 1.1.37

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.
@@ -0,0 +1,364 @@
1
+ import I18n from '@ledvance/base/src/i18n'
2
+ import { StripSceneInfo, RemoteSceneInfo } from '../../scene/SceneInfo'
3
+
4
+ export interface MixSceneInfo {
5
+ name: string
6
+ mainLamp: MixMainLampInfo
7
+ secondlyLamp: StripSceneInfo
8
+ }
9
+
10
+ export interface MixMainLampInfo {
11
+ id: number
12
+ speed: number
13
+ mode: number
14
+ nodes: MixSceneNodeInfo[]
15
+ }
16
+
17
+ export interface MixSceneNodeInfo {
18
+ h: number
19
+ s: number
20
+ v: number
21
+ brightness: number
22
+ colorTemp: number
23
+ }
24
+
25
+ export function getMixSceneList(): RemoteSceneInfo[] {
26
+ return [
27
+ {
28
+ n: I18n.getLang('mesh_device_detail_lighting_goodnight'),
29
+ i: '000e0d0000000000000000c80000',
30
+ s: '',
31
+ t: 0,
32
+ e: false,
33
+ },
34
+ {
35
+ n: I18n.getLang('mesh_device_detail_lighting_read'),
36
+ i: '010e0d0000000000000003e801f4',
37
+ s: '',
38
+ t: 0,
39
+ e: false,
40
+ },
41
+ {
42
+ n: I18n.getLang('mesh_device_detail_lighting_work'),
43
+ i: '020e0d0000000000000003e803e8',
44
+ s: '',
45
+ t: 0,
46
+ e: false,
47
+ },
48
+ {
49
+ n: I18n.getLang('mesh_device_detail_lighting_leisure'),
50
+ i: '030e0d0000000000000001f401f4',
51
+ s: '',
52
+ t: 0,
53
+ e: false,
54
+ },
55
+ {
56
+ n: I18n.getLang('strip_lights_mood_text1'),
57
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
58
+ s: '01150a5252e000006400c16100b43000b55200c463',
59
+ t: 0,
60
+ e: false,
61
+ },
62
+ {
63
+ n: I18n.getLang('strip_lights_mood_text2'),
64
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
65
+ s: '01160a64646000006400925f00c660',
66
+ t: 0,
67
+ e: false,
68
+ },
69
+ {
70
+ n: I18n.getLang('strip_lights_mood_text3'),
71
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
72
+ s: '0117035e5e6000006400382f001e5c00d545011a64',
73
+ t: 0,
74
+ e: false,
75
+ },
76
+ {
77
+ n: I18n.getLang('strip_lights_mood_text4'),
78
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
79
+ s: '0118026464e000006400b239010a64012d64013f64',
80
+ t: 0,
81
+ e: false
82
+ },
83
+ {
84
+ n: I18n.getLang('strip_lights_mood_text5'),
85
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
86
+ s: '01190a54546000006400b12c00c064',
87
+ t: 0,
88
+ e: false,
89
+ },
90
+ {
91
+ n: I18n.getLang('strip_lights_mood_text6'),
92
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
93
+ s: '011a034b4be000006400e039010953',
94
+ t: 0,
95
+ e: false,
96
+ },
97
+ {
98
+ n: I18n.getLang('strip_lights_mood_text7'),
99
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
100
+ s: '011b035f5f6000006400ae3900c45d00f964',
101
+ t: 0,
102
+ e: false,
103
+ },
104
+ {
105
+ n: I18n.getLang('strip_lights_mood_text8'),
106
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
107
+ s: '011c0a5a5ae0000052009d64008e64',
108
+ t: 0,
109
+ e: false,
110
+ },
111
+ {
112
+ n: I18n.getLang('strip_lights_mood_text9'),
113
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
114
+ s: '011d035252e000006400ae6400a66400c16400cc64',
115
+ t: 0,
116
+ e: false,
117
+ },
118
+ {
119
+ n: I18n.getLang('strip_lights_mood_text10'),
120
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
121
+ s: '011e0a5252e000006400196400225e002c5b001464000c64',
122
+ t: 0,
123
+ e: false,
124
+ },
125
+ {
126
+ n: I18n.getLang('strip_lights_mood_text11'),
127
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
128
+ s: '0147054d4d0000006401034500c143',
129
+ t: 0,
130
+ e: false,
131
+ },
132
+ {
133
+ n: I18n.getLang('strip_lights_mood_text12'),
134
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
135
+ s: '014806323200000064014e41001f49',
136
+ t: 0,
137
+ e: false,
138
+ },
139
+ {
140
+ n: I18n.getLang('strip_lights_mood_text13'),
141
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
142
+ s: '0149070e0e0000006400da37015241005c37',
143
+ t: 0,
144
+ e: false,
145
+ },
146
+ {
147
+ n: I18n.getLang('strip_lights_mood_text14'),
148
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
149
+ s: '014a0832320000006400f75000294f010d3800a327',
150
+ t: 0,
151
+ e: false,
152
+ },
153
+ {
154
+ n: I18n.getLang('strip_lights_mood_text15'),
155
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
156
+ s: '014b0932320000006401034500413a00254b005e42',
157
+ t: 0,
158
+ e: false,
159
+ },
160
+ {
161
+ n: I18n.getLang('strip_lights_mood_text16'),
162
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
163
+ s: '014c0c32320000006400d84d00c143010345005c37',
164
+ t: 0,
165
+ e: false,
166
+ },
167
+ {
168
+ n: I18n.getLang('strip_lights_mood_text17'),
169
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
170
+ s: '014d0d323200000064002864005e4200c16400ff50',
171
+ t: 0,
172
+ e: false,
173
+ },
174
+ {
175
+ n: I18n.getLang('strip_lights_mood_text18'),
176
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
177
+ s: '014e0e323200000064003e5f00be5c',
178
+ t: 0,
179
+ e: false,
180
+ },
181
+ {
182
+ n: I18n.getLang('strip_lights_mood_text19'),
183
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
184
+ s: '014f0f19190000006400bc64002d4e00006400643c',
185
+ t: 0,
186
+ e: false,
187
+ },
188
+ {
189
+ n: I18n.getLang('strip_lights_mood_text20'),
190
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
191
+ s: '01501032320000006400e64700643c01194d00b839',
192
+ t: 0,
193
+ e: false,
194
+ },
195
+ {
196
+ n: I18n.getLang('strip_lights_mood_text21'),
197
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
198
+ s: '011f025f5f6000006401106400d26400ad64008b64',
199
+ t: 0,
200
+ e: false,
201
+ },
202
+ {
203
+ n: I18n.getLang('strip_lights_mood_text22'),
204
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
205
+ s: '01200a55556000006400c258013e3300ff46011d64',
206
+ t: 0,
207
+ e: false,
208
+ },
209
+ {
210
+ n: I18n.getLang('strip_lights_mood_text23'),
211
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
212
+ s: '0121033c3c6000006400bf18010417',
213
+ t: 0,
214
+ e: false,
215
+ },
216
+ {
217
+ n: I18n.getLang('strip_lights_mood_text24'),
218
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
219
+ s: '01220464646000006400d75c00bc5300371e002c3f01613f',
220
+ t: 0,
221
+ e: false,
222
+ },
223
+ {
224
+ n: I18n.getLang('strip_lights_mood_text25'),
225
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
226
+ s: '01230264646000006401084b00b12f00cd57',
227
+ t: 0,
228
+ e: false,
229
+ },
230
+ {
231
+ n: I18n.getLang('strip_lights_mood_text26'),
232
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
233
+ s: '01240a4b4b6000006400bc2600d65501186400f94d',
234
+ t: 0,
235
+ e: false,
236
+ },
237
+ {
238
+ n: I18n.getLang('strip_lights_mood_text27'),
239
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
240
+ s: '01250343436000006400b735009b5400cd61',
241
+ t: 0,
242
+ e: false,
243
+ },
244
+ {
245
+ n: I18n.getLang('strip_lights_mood_text28'),
246
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
247
+ s: '0126015959e000006401194701493d00cd61002664',
248
+ t: 0,
249
+ e: false,
250
+ },
251
+ {
252
+ n: I18n.getLang('strip_lights_mood_text29'),
253
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
254
+ s: '0129026161e0000064000b6400d964002b6400916400b964',
255
+ t: 0,
256
+ e: false,
257
+ },
258
+ {
259
+ n: I18n.getLang('strip_lights_mood_text30'),
260
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
261
+ s: '012a01646460000064011564010564014564012f64',
262
+ t: 0,
263
+ e: false,
264
+ },
265
+ {
266
+ n: I18n.getLang('strip_lights_mood_text31'),
267
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
268
+ s: '012b035a5ae000006400005701166400da6400b364009564',
269
+ t: 0,
270
+ e: false,
271
+ },
272
+ {
273
+ n: I18n.getLang('strip_lights_mood_text32'),
274
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
275
+ s: '012c0a484860000064003d64010c5b00ba49001761',
276
+ t: 0,
277
+ e: false,
278
+ },
279
+ {
280
+ n: I18n.getLang('strip_lights_mood_text33'),
281
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
282
+ s: '012d02595960000064009c6300bc62007b60',
283
+ t: 0,
284
+ e: false,
285
+ },
286
+ {
287
+ n: I18n.getLang('strip_lights_mood_text34'),
288
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
289
+ s: '012e035a5a60000064013e36010c56011f23',
290
+ t: 0,
291
+ e: false,
292
+ },
293
+ {
294
+ n: I18n.getLang('strip_lights_mood_text35'),
295
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
296
+ s: '012f026464e000006400dc4200b64a00e14d',
297
+ t: 0,
298
+ e: false,
299
+ },
300
+ {
301
+ n: I18n.getLang('strip_lights_mood_text36'),
302
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
303
+ s: '0130025e5e6000006400006400786400bb64',
304
+ t: 0,
305
+ e: false,
306
+ },
307
+ {
308
+ n: I18n.getLang('strip_lights_mood_text37'),
309
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
310
+ s: '01330352526000006400885000d23900fb27',
311
+ t: 0,
312
+ e: false,
313
+ },
314
+ {
315
+ n: I18n.getLang('strip_lights_mood_text38'),
316
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
317
+ s: '0134035d5d6000006400f73601352b00c634009129',
318
+ t: 0,
319
+ e: false,
320
+ },
321
+ {
322
+ n: I18n.getLang('strip_lights_mood_text39'),
323
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
324
+ s: '01350352526000004d01126201305d',
325
+ t: 0,
326
+ e: false,
327
+ },
328
+ {
329
+ n: I18n.getLang('strip_lights_mood_text40'),
330
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
331
+ s: '01360249496000006400663c003c49001e64',
332
+ t: 0,
333
+ e: false,
334
+ },
335
+ {
336
+ n: I18n.getLang('strip_lights_mood_text41'),
337
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
338
+ s: '01370a5a5a6000006400335800186401004500e35e00ac30',
339
+ t: 0,
340
+ e: false,
341
+ },
342
+ {
343
+ n: I18n.getLang('strip_lights_mood_text42'),
344
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
345
+ s: '0138025757e0000064010c64011a41014759001564003c38',
346
+ t: 0,
347
+ e: false,
348
+ },
349
+ {
350
+ n: I18n.getLang('strip_lights_mood_text43'),
351
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
352
+ s: '0139034848e000006400596400b347',
353
+ t: 0,
354
+ e: false,
355
+ },
356
+ {
357
+ n: I18n.getLang('strip_lights_mood_text44'),
358
+ i: '040d0d0100000000000003e800000d0d0100000000000003e80000',
359
+ s: '013a025d5de000004d00b45e011c6400e84900c65f',
360
+ t: 0,
361
+ e: false,
362
+ },
363
+ ]
364
+ }
@@ -0,0 +1,68 @@
1
+ import React from 'react'
2
+ import { Utils } from 'tuya-panel-kit'
3
+ import Card from '@ledvance/base/src/components/Card'
4
+ import { CellContent } from '@ledvance/base/src/components/Cell'
5
+ import { StyleSheet, View } from 'react-native'
6
+ import Spacer from '@ledvance/base/src/components/Spacer'
7
+ import { MixSceneInfo } from './MixSceneBeans'
8
+ import { MixMoodColorsLine } from './MixMoodItem'
9
+
10
+ const cx = Utils.RatioUtils.convertX
11
+
12
+ interface RecommendMixMoodItemProps {
13
+ title: string
14
+ isStatic: boolean
15
+ mixMood?: MixSceneInfo
16
+ onPress: () => void
17
+ }
18
+
19
+ const RecommendMixMoodItem = (props: RecommendMixMoodItemProps) => {
20
+ const { mixMood, isStatic } = props
21
+
22
+ return (
23
+ <Card style={styles.root} onPress={props.onPress}>
24
+ <CellContent
25
+ title={props.title}
26
+ value={''}
27
+ style={styles.content}
28
+ titleStyle={styles.title}
29
+ iconStyle={{
30
+ color: '#000',
31
+ size: cx(16),
32
+ }} />
33
+ {!!mixMood &&
34
+ (<>
35
+ <View style={styles.lineStyle}>
36
+ <MixMoodColorsLine mixSubLight={mixMood?.mainLamp} colorLight={false} />
37
+ <Spacer height={cx(7)} />
38
+ {!isStatic && <MixMoodColorsLine mixSubLight={mixMood?.secondlyLamp} colorLight={true} />}
39
+ </View>
40
+ <Spacer height={cx(24)} />
41
+ </>
42
+ )
43
+ }
44
+ </Card>
45
+ )
46
+ }
47
+
48
+ const styles = StyleSheet.create({
49
+ root: {
50
+ flexDirection: 'row',
51
+ alignItems: 'center',
52
+ marginHorizontal: cx(24),
53
+ },
54
+ content: {
55
+ height: cx(56),
56
+ marginHorizontal: cx(16),
57
+ },
58
+ title: {
59
+ color: '#000',
60
+ fontSize: cx(16),
61
+ fontFamily: 'helvetica_neue_lt_std_bd',
62
+ },
63
+ lineStyle: {
64
+ alignItems: 'center',
65
+ },
66
+ })
67
+
68
+ export default RecommendMixMoodItem
@@ -59,6 +59,7 @@ const DeviceState = (props: DeviceStateProps) => {
59
59
  isSupportTemperature={props.isSupportTemperature}
60
60
  isStringLight={props.isStringLight}
61
61
  isStripLight={props.isStripLight}
62
+ isCeilingLight={props.isCeilingLight}
62
63
  /> :
63
64
  <View>
64
65
  {
@@ -74,6 +75,7 @@ const DeviceState = (props: DeviceStateProps) => {
74
75
  fantasyFeatureId={props.fantasyFeatureId}
75
76
  isStringLight={props.isStringLight}
76
77
  isStripLight={props.isStripLight}
78
+ isCeilingLight={props.isCeilingLight}
77
79
  isOnlyRGBLamp={props.isOnlyRGBLamp}
78
80
  isDIMLamp={props.isDIMLamp}
79
81
  isRGBLamp={props.isRGBLamp}
@@ -13,7 +13,9 @@ import LdvSwitch from '@ledvance/base/src/components/ldvSwitch'
13
13
  import Spacer from '@ledvance/base/src/components/Spacer'
14
14
  import { hsv2Hex, mapFloatToRange } from '@ledvance/base/src/utils'
15
15
  import { cctToColor } from '@ledvance/base/src/utils/cctUtils'
16
-
16
+ import ColorTempAdjustView from '@ledvance/base/src/components/ColorTempAdjustView'
17
+ import { Utils } from 'tuya-panel-kit'
18
+ const { convertX: cx } = Utils.RatioUtils
17
19
 
18
20
  interface ManualSettingProps extends JudgeTimeScheduleProps {
19
21
  singleActions: any
@@ -32,17 +34,17 @@ const ManualSetting = (props: ManualSettingProps) => {
32
34
  mixActions: props.mixActions,
33
35
  flag: Symbol(),
34
36
  })
35
- const tabList = useCreation(() =>{
36
- const isSupportWhite = props.isSupportBrightness || props.isSupportTemperature
37
+ const tabList = useCreation(() => {
38
+ const isSupportWhite = props.isCeilingLight ? false : (props.isSupportBrightness || props.isSupportTemperature)
37
39
  const tabs = [
38
40
  { key: 1, title: I18n.getLang('add_new_static_mood_lights_schedule_switch_tab_color_text') },
39
41
  { key: 0, title: I18n.getLang('add_new_static_mood_lights_schedule_switch_tab_white_text') },
40
42
  { key: 3, title: I18n.getLang('add_new_dynamic_mood_strip_lights_schedule_switch_tab_combination_text') },
41
43
  ]
42
- if(!isSupportWhite){
44
+ if (!isSupportWhite || props.isCeilingLight) {
43
45
  return tabs.filter(tab => tab.key !== 0)
44
46
  }
45
- if(!props.isSupportColor){
47
+ if (!props.isSupportColor) {
46
48
  return tabs.filter(tab => tab.key === 0)
47
49
  }
48
50
  return tabs
@@ -56,26 +58,63 @@ const ManualSetting = (props: ManualSettingProps) => {
56
58
  props.setSendDps(state.singleActions, 'singleActions')
57
59
  }, [state.flag])
58
60
 
59
- const getColorBlockColor = useCallback(() =>{
60
- if(!state.singleActions.enable) return '#fff'
61
+ const getColorBlockColor = useCallback(() => {
62
+ if (!state.singleActions.enable) return '#fff'
61
63
  const s = Math.round(mapFloatToRange(state.singleActions.s / 100, 30, 100))
62
- if(props.isSupportColor && state.singleActions.activeKey === 1){
64
+ if (props.isSupportColor && state.singleActions.activeKey === 1) {
63
65
  return hsv2Hex(state.singleActions.h, s, 100)
64
66
  }
65
- if(props.isSupportTemperature && state.singleActions.activeKey === 0){
67
+ if (props.isSupportTemperature && state.singleActions.activeKey === 0) {
66
68
  return cctToColor(state.singleActions.temperature.toFixed())
67
69
  }
68
70
  return '#fff'
69
71
  }, [state.singleActions])
70
72
 
71
73
  const renderContent = () => {
72
- if (props.isStripLight) {
74
+ if (props.isStripLight || props.isCeilingLight) {
73
75
  return (
74
76
  <>
77
+ {props.isCeilingLight && <><Spacer />
78
+ <Card>
79
+ <LdvSwitch
80
+ title={I18n.getLang('light_sources_tile_main_lighting_headline')}
81
+ color={cctToColor(state.singleActions.temperature)}
82
+ colorAlpha={1}
83
+ enable={state.singleActions.whiteLightSwitch}
84
+ setEnable={async value => {
85
+ state.singleActions.whiteLightSwitch = value
86
+ state.flag = Symbol()
87
+ }} />
88
+ {state.singleActions.whiteLightSwitch && <>
89
+ <ColorTempAdjustView
90
+ minBrightness={1}
91
+ isSupportTemperature={!!props.isSupportTemperature}
92
+ isSupportBrightness={!!props.isSupportBrightness}
93
+ colorTemp={state.singleActions.temperature}
94
+ brightness={state.singleActions.brightness}
95
+ onCCTChange={() => { }}
96
+ onCCTChangeComplete={(temperature) => {
97
+ state.singleActions = {
98
+ ...state.singleActions,
99
+ temperature
100
+ }
101
+ state.flag = Symbol()
102
+ }}
103
+ onBrightnessChange={() => { }}
104
+ onBrightnessChangeComplete={brightness => {
105
+ state.singleActions = {
106
+ ...state.singleActions,
107
+ brightness
108
+ }
109
+ state.flag = Symbol()
110
+ }} />
111
+ <Spacer height={cx(10)} />
112
+ </>}
113
+ </Card></>}
75
114
  <Spacer />
76
115
  <Card>
77
116
  <LdvSwitch
78
- title={I18n.getLang('light_sources_tile_tw_lighting_headline')}
117
+ title={I18n.getLang(props.isCeilingLight ? 'light_sources_tile_sec_lighting_headline' : 'light_sources_tile_tw_lighting_headline')}
79
118
  color={getColorBlockColor()}
80
119
  colorAlpha={1}
81
120
  enable={state.singleActions.enable}
@@ -106,8 +145,8 @@ const ManualSetting = (props: ManualSettingProps) => {
106
145
  }
107
146
  state.flag = Symbol()
108
147
  }}
109
- isSupportTemperature={!!props.isSupportTemperature}
110
- isSupportBrightness={!!props.isSupportBrightness}
148
+ isSupportTemperature={!!props.isSupportTemperature && !props.isCeilingLight}
149
+ isSupportBrightness={!!props.isSupportBrightness && !props.isCeilingLight}
111
150
  h={state.singleActions.h} s={state.singleActions.s} v={state.singleActions.v}
112
151
  onHSVChange={() => { }}
113
152
  onHSVChangeComplete={async (h, s, v) => {
@@ -147,6 +186,8 @@ const ManualSetting = (props: ManualSettingProps) => {
147
186
  <MixLightView
148
187
  mixActions={state.mixActions}
149
188
  setSendDps={props.setSendDps}
189
+ isSupportBrightness={props.isSupportBrightness}
190
+ isSupportTemperature={props.isSupportTemperature}
150
191
  />
151
192
  )
152
193
  }