@ledvance/group-ui-biz-bundle 1.0.91 → 1.0.93

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.
Files changed (33) hide show
  1. package/package.json +1 -1
  2. package/src/modules/biorhythm/BiorhythmBean.ts +1 -1
  3. package/src/modules/diyScene/DefaultScenes.ts +439 -0
  4. package/src/modules/diyScene/DiySceneActions.ts +206 -0
  5. package/src/modules/diyScene/DiySceneEditorPage.tsx +356 -0
  6. package/src/modules/diyScene/DiyScenePage.tsx +281 -0
  7. package/src/modules/diyScene/Router.ts +25 -0
  8. package/src/modules/energyConsumption/EnergyConsumptionActions.ts +134 -119
  9. package/src/modules/energyConsumption/EnergyConsumptionChart.tsx +30 -9
  10. package/src/modules/energyConsumption/component/DateSwitch.tsx +111 -0
  11. package/src/modules/energyConsumption/component/NewBarChart.tsx +16 -3
  12. package/src/modules/fixedTimeForPlug/FixedTimeForPlugPage.tsx +14 -0
  13. package/src/modules/fixedTimeForPlug/ItemCard.tsx +3 -2
  14. package/src/modules/fixedTimingForLight/FixedTimingForLightPage.tsx +14 -0
  15. package/src/modules/fixedTimingForLight/ItemCard.tsx +3 -2
  16. package/src/modules/flags/FlagActions.ts +3 -1
  17. package/src/modules/flags/FlagPage.tsx +4 -3
  18. package/src/modules/mood_new/Interface.ts +1 -0
  19. package/src/modules/mood_new/MoodActions.ts +12 -1
  20. package/src/modules/mood_new/MoodItem.tsx +2 -1
  21. package/src/modules/mood_new/MoodPage.tsx +34 -12
  22. package/src/modules/randomTimeForPlug/ItemCard.tsx +3 -2
  23. package/src/modules/randomTimeForPlug/RandomTimeForPlugPage.tsx +14 -0
  24. package/src/modules/randomTimingForLight/RandomTimingForLightPage.tsx +14 -0
  25. package/src/modules/sleepWakeUp/SleepWakeUpPage.tsx +34 -5
  26. package/src/modules/timeSchedule/Interface.ts +19 -10
  27. package/src/modules/timeSchedule/TimeScheduleActions.ts +7 -1
  28. package/src/modules/timeSchedule/TimeScheduleDetailPage.tsx +116 -26
  29. package/src/modules/timeSchedule/TimeSchedulePage.tsx +1 -0
  30. package/src/modules/timeSchedule/components/ManuaSettings.tsx +35 -3
  31. package/src/modules/timeSchedule/components/ScheduleCard.tsx +5 -6
  32. package/src/modules/timer/TimerAction.ts +1 -1
  33. package/src/navigation/Routers.ts +3 -1
@@ -15,6 +15,9 @@ import { useGroupDevices } from '@ledvance/base/src/models/modules/NativePropsSl
15
15
  import ApplyForDeviceList from '@ledvance/base/src/components/ApplyForDeviceList';
16
16
  import { cloneDeep } from 'lodash';
17
17
  import { FanAdjustViewContent } from '@ledvance/base/src/components/FanAdjustView';
18
+ import { cctToColor } from '@ledvance/base/src/utils/cctUtils';
19
+ import {hsv2Hex, mapFloatToRange } from '@ledvance/base/src/utils';
20
+ import { AdjustType } from '@ledvance/base/src/utils/interface';
18
21
  const { convertX: cx } = Utils.RatioUtils;
19
22
  const { withTheme } = Utils.ThemeUtils
20
23
 
@@ -66,6 +69,14 @@ function ManualSettings(props: ManualSettingProps) {
66
69
 
67
70
  const lightSourceCard = useMemo(() => {
68
71
  const { deviceData } = state;
72
+ const getBlockColor = () => {
73
+ if (!deviceData.isColorMode) return cctToColor(deviceData.temperature)
74
+ if (deviceData.isColorMode) {
75
+ const s = Math.round(mapFloatToRange(deviceData.s / 100, 30, 100))
76
+ return hsv2Hex(deviceData.h, s, 100)
77
+ }
78
+ return props.theme?.card?.background
79
+ };
69
80
  return (
70
81
  <View>
71
82
  {state.applyForList.map((item, idx) => (
@@ -73,7 +84,7 @@ function ManualSettings(props: ManualSettingProps) {
73
84
  <Card style={{ marginHorizontal: cx(24) }}>
74
85
  <LdvSwitch
75
86
  title={item.name || item.key}
76
- color={props.theme?.card.background}
87
+ color={getBlockColor()}
77
88
  colorAlpha={1}
78
89
  enable={item.enable}
79
90
  setEnable={(enable: boolean) => {
@@ -99,6 +110,7 @@ function ManualSettings(props: ManualSettingProps) {
99
110
  state.deviceData = {
100
111
  ...state.deviceData,
101
112
  isColorMode: mode,
113
+ adjustType: mode ? AdjustType.COLOUR : AdjustType.WHITE
102
114
  };
103
115
  state.manualFlag = Symbol()
104
116
  }}
@@ -195,6 +207,15 @@ function ManualSettings(props: ManualSettingProps) {
195
207
  }, [state.deviceData, state.applyForList, props.theme?.card.background]);
196
208
 
197
209
  const mixLightCard = useMemo(() => {
210
+ const {deviceData} = state;
211
+ const getBlockColor = ((type: string) => {
212
+ if (type === 'mainLight') return cctToColor(deviceData.temperature);
213
+ if (type === 'secondaryLight') {
214
+ const s = Math.round(mapFloatToRange(deviceData.s / 100, 30, 100));
215
+ return hsv2Hex(deviceData.h, s, 100);
216
+ }
217
+ return props.theme?.card?.background;
218
+ });
198
219
  return (
199
220
  <View>
200
221
  {state.applyForList.map((item, idx) => (
@@ -202,7 +223,7 @@ function ManualSettings(props: ManualSettingProps) {
202
223
  <Card style={{ marginHorizontal: cx(24) }}>
203
224
  <LdvSwitch
204
225
  title={item.key}
205
- color={props.theme?.card.background}
226
+ color={getBlockColor(item.type)}
206
227
  colorAlpha={1}
207
228
  enable={item.enable}
208
229
  setEnable={(enable: boolean) => {
@@ -331,6 +352,17 @@ function ManualSettings(props: ManualSettingProps) {
331
352
 
332
353
  const ceilingLightCard = useMemo(() => {
333
354
  const deviceData = state.deviceData as CeilingLightData
355
+ const getBlockColor = (type: string) => {
356
+ if (type === 'mainLight') {
357
+ return cctToColor(deviceData.temperature);
358
+ }
359
+ // deviceData.activeKey === 3为combination
360
+ if (type === 'secondaryLight' && deviceData.activeKey !== 3) {
361
+ const s = Math.round(mapFloatToRange(deviceData.s / 100, 30, 100));
362
+ return hsv2Hex(deviceData.h, s, 100);
363
+ }
364
+ return props.theme?.card.background;
365
+ }
334
366
  return (
335
367
  <View>
336
368
  {state.applyForList.map((item, idx) => (
@@ -338,7 +370,7 @@ function ManualSettings(props: ManualSettingProps) {
338
370
  <Card style={{ marginHorizontal: cx(24) }}>
339
371
  <LdvSwitch
340
372
  title={item.key}
341
- color={props.theme?.card.background}
373
+ color={getBlockColor(item.type)}
342
374
  colorAlpha={1}
343
375
  enable={item.enable}
344
376
  setEnable={(enable: boolean) => {
@@ -15,11 +15,12 @@ interface ScheduleCardProps {
15
15
  item: Timer
16
16
  style?: ViewStyle
17
17
  onEnableChange: (enable: boolean) => void
18
- onPress: (item: any) => void
18
+ onPress: () => void
19
+ onLongPress: () => void
19
20
  }
20
21
 
21
22
  const ScheduleCard = (props: ScheduleCardProps) => {
22
- const { item, style, onEnableChange, onPress } = props;
23
+ const { item, style, onEnableChange, onPress, onLongPress } = props;
23
24
  const is24HourClock = useSystemTimeFormate()
24
25
 
25
26
  const styles = StyleSheet.create({
@@ -67,10 +68,8 @@ const ScheduleCard = (props: ScheduleCardProps) => {
67
68
  <Card
68
69
  style={styles.card}
69
70
  containerStyle={[styles.container, style]}
70
- onPress={() => {
71
- onPress(item);
72
- }}
73
- >
71
+ onPress={onPress}
72
+ onLongPress={onLongPress}>
74
73
  <View style={styles.infoContainer}>
75
74
  <Text style={styles.time}>{is24HourClock ? item.time : convertTo12HourFormat(item.time)}</Text>
76
75
  <Text style={styles.loop}>
@@ -78,7 +78,7 @@ export function useTimerTasks(timerSettableDps: TimerSettableDp[], devIdGroup: s
78
78
  dps[task.dp.code] = task.duration
79
79
  const featureKey = timerSettableDps.find(timerSettableDp => timerSettableDp.dp.code === task.dp.code)?.cloudKey
80
80
  devIdGroup.forEach(devId => {
81
- NativeApi.putJson(devId, task.cloudKey ?? featureKey, JSON.stringify({ [getKey('Status', task.dp.code)]: !!task.duration, [getKey('StartTime', task.dp.code)]: task.startTime, progressAllNumber: task.duration }))
81
+ NativeApi.putJson(devId, task.cloudKey ?? featureKey, JSON.stringify({ [getKey('Status', task.dp.code)]: !!task.duration, [getKey('StartTime', task.dp.code)]: dayjs(task.startTime * 1000).format('YYYY-MM-DD HH:mm:ss'), progressAllNumber: task.duration }))
82
82
  })
83
83
  })
84
84
  return dps
@@ -32,5 +32,7 @@ export const ui_biz_routerKey = {
32
32
  'group_ui_biz_switch_inching': 'group_ui_biz_switch_inching',
33
33
  'group_ui_biz_energy_consumption': 'group_ui_biz_energy_consumption',
34
34
  'group_ui_biz_energy_consumption_detail': 'group_ui_biz_energy_consumption_detail',
35
- 'group_ui_biz_energy_consumption_chart': 'group_ui_biz_energy_consumption_chart'
35
+ 'group_ui_biz_energy_consumption_chart': 'group_ui_biz_energy_consumption_chart',
36
+ 'group_ui_biz_diy_scene_page': 'group_ui_biz_diy_scene_page',
37
+ 'group_ui_biz_diy_scene_edit_page': 'group_ui_biz_diy_scene_edit_page'
36
38
  }