@ledvance/group-ui-biz-bundle 1.0.130 → 1.0.131

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.130",
7
+ "version": "1.0.131",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
10
  "@ledvance/base": "^1.x",
@@ -30,7 +30,7 @@ export default function RecommendMoodItem(props: RecommendMoodItemProps) {
30
30
  value={''}
31
31
  style={styles.content}
32
32
  titleStyle={styles.title}
33
- iconStyle={{
33
+ arrowStyle={{
34
34
  color: '#000',
35
35
  size: cx(16),
36
36
  }} />
@@ -63,7 +63,7 @@ const RecommendMixMoodItem = (props: RecommendMixMoodItemProps) => {
63
63
  value={''}
64
64
  style={styles.content}
65
65
  titleStyle={styles.title}
66
- iconStyle={{
66
+ arrowStyle={{
67
67
  color: props.theme?.global.fontColor,
68
68
  size: cx(16),
69
69
  }}
@@ -1,5 +1,5 @@
1
1
  import I18n from "@ledvance/base/src/i18n";
2
- import { AdjustType, DiySceneInfo } from "@ledvance/base/src/utils/interface";
2
+ import { AdjustType, ApplyForItem, DiySceneInfo } from "@ledvance/base/src/utils/interface";
3
3
  import { MoodInfo, MoodUIInfo } from "../mood_new/Interface";
4
4
 
5
5
  export interface IAddSingleTime {
@@ -62,16 +62,6 @@ export interface HSV {
62
62
  v: number;
63
63
  }
64
64
 
65
- export type Category = 'light' | 'socket' | 'fan' | 'mainLight' | 'secondaryLight'
66
-
67
- export interface ApplyForItem {
68
- name?: string
69
- key: string;
70
- dp: string;
71
- type: Category;
72
- enable: boolean;
73
- }
74
-
75
65
  interface judgmentSupport {
76
66
  isSupportColor: boolean;
77
67
  isSupportBrightness: boolean;
@@ -102,6 +92,7 @@ export enum DeviceType {
102
92
  FanLight = 'fanLight',
103
93
  MoodStrip = 'moodStrip',
104
94
  Shutter = 'shutter',
95
+ OsramFanLight = 'osramFanLight',
105
96
  }
106
97
  // export type DeviceType = 'LightSource' | 'CeilingLight' | 'StringLight' | 'StripLight' | 'MixLight';
107
98
 
@@ -144,6 +135,11 @@ export interface ShutterData extends DeviceData {
144
135
  percentControl: number
145
136
  }
146
137
 
138
+ export interface OsramFanLightData extends DeviceData {
139
+ fanMode: 'fresh' | 'nature'
140
+ fanSpeed: number
141
+ }
142
+
147
143
  export type ComponentConfig =
148
144
  | { type: DeviceType.LightSource; deviceData: DeviceData }
149
145
  | { type: DeviceType.MixLight; deviceData: MixLightData }
@@ -152,6 +148,8 @@ export type ComponentConfig =
152
148
  | { type: DeviceType.FanLight; deviceData: FanLightData }
153
149
  | { type: DeviceType.MoodStrip; deviceData: MoodStripData}
154
150
  | { type: DeviceType.Shutter; deviceData: ShutterData}
151
+ | { type: DeviceType.OsramFanLight; deviceData: OsramFanLightData}
152
+
155
153
  export interface TimeScheduleDetailState {
156
154
  timeSchedule: Timer;
157
155
  dps: Record<string, any>;
@@ -47,7 +47,13 @@ export const defMoodStripDeviceData = {
47
47
 
48
48
  export const defShutterDeviceData = {
49
49
  percentControl: 100
50
- };
50
+ }
51
+
52
+ export const defOsramFanLightDeviceData = {
53
+ ...defDeviceData,
54
+ fanSpeed: 1,
55
+ fanMode: 'fresh',
56
+ }
51
57
 
52
58
  export const addTimeSchedule = async (props: IAddSingleTime) => {
53
59
  try {
@@ -19,7 +19,6 @@ import Spacer from '@ledvance/base/src/components/Spacer';
19
19
  import LdvWeekView from '@ledvance/base/src/components/weekSelect';
20
20
  import { convertTo12HourFormat, loopText, showDialog } from '@ledvance/base/src/utils/common';
21
21
  import {
22
- ApplyForItem,
23
22
  ComponentConfig,
24
23
  DeviceType,
25
24
  TimeScheduleDetailState,
@@ -37,7 +36,7 @@ import DeleteButton from '@ledvance/base/src/components/DeleteButton';
37
36
  import SegmentControl from '@ledvance/base/src/components/segmentControl';
38
37
  import { useParams } from '@ledvance/base/src/hooks/Hooks';
39
38
  import ManualSettings from './components/ManuaSettings';
40
- import { defDeviceData, defMixDeviceData, defStripDeviceData, defFanLightDeviceData, defMoodStripDeviceData, defShutterDeviceData } from './TimeScheduleActions';
39
+ import { defDeviceData, defMixDeviceData, defStripDeviceData, defFanLightDeviceData, defMoodStripDeviceData, defShutterDeviceData, defOsramFanLightDeviceData } from './TimeScheduleActions';
41
40
  import MoodItem from '../mood_new/MoodItem';
42
41
  import Summary from './components/Summary'
43
42
  import { getRemoteMoodList } from '../mood_new/MoodActions'
@@ -45,7 +44,7 @@ import { MoodInfo, MoodUIInfo } from '../mood_new/Interface';
45
44
  import InfoText from '@ledvance/base/src/components/InfoText';
46
45
  import ThemeType from '@ledvance/base/src/config/themeType'
47
46
  import Tag from '@ledvance/base/src/components/Tag';
48
- import { DiySceneInfo } from '@ledvance/base/src/utils/interface';
47
+ import { ApplyForItem, DiySceneInfo } from '@ledvance/base/src/utils/interface';
49
48
  import DiySceneItem from '@ledvance/base/src/components/DiySceneItem';
50
49
 
51
50
  const { convertX: cx } = Utils.RatioUtils;
@@ -679,7 +678,8 @@ const getDefaultManual = (props: TimeScheduleDetailPageParams): ComponentConfig
679
678
  isFanLight: DeviceType.FanLight,
680
679
  isCeilingLight: DeviceType.CeilingLight,
681
680
  isMoodStrip: DeviceType.MoodStrip,
682
- isShutter: DeviceType.Shutter
681
+ isShutter: DeviceType.Shutter,
682
+ isOsramFanLight: DeviceType.OsramFanLight,
683
683
  };
684
684
 
685
685
  const deviceType = Object.entries(deviceTypeMap)
@@ -693,6 +693,7 @@ const getDefaultManual = (props: TimeScheduleDetailPageParams): ComponentConfig
693
693
  [DeviceType.FanLight]: defFanLightDeviceData,
694
694
  [DeviceType.MoodStrip]: defMoodStripDeviceData,
695
695
  [DeviceType.Shutter]: defShutterDeviceData,
696
+ [DeviceType.OsramFanLight]: defOsramFanLightDeviceData,
696
697
  [DeviceType.LightSource]: defDeviceData,
697
698
  };
698
699
 
@@ -37,6 +37,7 @@ export interface TimeSchedulePageParams {
37
37
  isUVCFan?: boolean;
38
38
  isMoodStrip?: boolean
39
39
  isShutter?: boolean
40
+ isOsramFan?: boolean
40
41
  applyForList: ApplyForItem[];
41
42
  applyForDisabled?: boolean; // 是否可以选择apply for
42
43
  manualDataDp2Obj: (dps: Record<string, any>) => DeviceStateType;
@@ -8,6 +8,7 @@ import {
8
8
  directOptions,
9
9
  modeOptions,
10
10
  ShutterData,
11
+ OsramFanLightData,
11
12
  } from '../Interface';
12
13
  import { View } from 'react-native';
13
14
  import Card from '@ledvance/base/src/components/Card';
@@ -28,6 +29,8 @@ import { cctToColor } from '@ledvance/base/src/utils/cctUtils';
28
29
  import {hsv2Hex, mapFloatToRange } from '@ledvance/base/src/utils';
29
30
  import { AdjustType, ApplyForItem } from '@ledvance/base/src/utils/interface';
30
31
  import LdvSlider from '@ledvance/base/src/components/ldvSlider';
32
+ import OsramFanAdjustView from '@ledvance/base/src/components/OsramFanAdjustView'
33
+
31
34
  const { convertX: cx } = Utils.RatioUtils;
32
35
  const { withTheme } = Utils.ThemeUtils
33
36
 
@@ -112,7 +115,7 @@ function ManualSettings(props: ManualSettingProps) {
112
115
  state.applyFlag = Symbol()
113
116
  }}
114
117
  />
115
- {item.enable && (item.type !== 'socket' && item.type !== 'fan') && (
118
+ {item.enable && !['socket', 'fan', 'osramFan'].includes(item.type) && (
116
119
  <LampAdjustView
117
120
  isSupportColor={props.isSupportColor}
118
121
  isSupportBrightness={props.isSupportBrightness}
@@ -206,6 +209,30 @@ function ManualSettings(props: ManualSettingProps) {
206
209
  />
207
210
  )}
208
211
 
212
+ {item.enable && item.type === 'osramFan' && (
213
+ <OsramFanAdjustView
214
+ hideFanSwitch={true}
215
+ fanSwitch={item.enable}
216
+ setFanSwitch={() => {}}
217
+ fanSpeed={(state.deviceData as OsramFanLightData).fanSpeed}
218
+ setFanSpeed={(v: number) => {
219
+ state.deviceData = {
220
+ ...state.deviceData,
221
+ fanSpeed: v
222
+ }
223
+ state.manualFlag = Symbol()
224
+ }}
225
+ fanMode={(state.deviceData as OsramFanLightData).fanMode}
226
+ setFanMode={(v: 'fresh' | 'nature') => {
227
+ state.deviceData = {
228
+ ...state.deviceData,
229
+ fanMode: v
230
+ }
231
+ state.manualFlag = Symbol()
232
+ }}
233
+ />
234
+ )}
235
+
209
236
  <ApplyForDeviceList
210
237
  devices={cloneDeep(groupDevices)}
211
238
  />
@@ -22,6 +22,7 @@ export interface TimerTask {
22
22
  stringOnMin: I18nKey
23
23
  stringOffMin: I18nKey
24
24
  cloudKey: 'lightingInfo' | 'socketInfo' | 'fanInfo' | 'plugCountDownInfo'
25
+ displayToDpValue?: (value: number) => number
25
26
  }
26
27
 
27
28
  export enum TaskStatus {
@@ -65,6 +66,7 @@ export function useTimerTasks(timerSettableDps: TimerSettableDp[], devIdGroup: s
65
66
  stringOnMin: timerSettableDp.stringOnMin,
66
67
  stringOffMin: timerSettableDp.stringOffMin,
67
68
  cloudKey: timerSettableDp.cloudKey,
69
+ displayToDpValue: timerSettableDp.displayToDpValue,
68
70
  }))
69
71
  }, [JSON.stringify(timerSettableDps)])
70
72
 
@@ -75,7 +77,7 @@ export function useTimerTasks(timerSettableDps: TimerSettableDp[], devIdGroup: s
75
77
  timerTasks => {
76
78
  const dps = {}
77
79
  timerTasks.forEach(task => {
78
- dps[task.dp.code] = task.duration
80
+ dps[task.dp.code] = task.displayToDpValue ? task.displayToDpValue(task.duration) : task.duration
79
81
  const featureKey = timerSettableDps.find(timerSettableDp => timerSettableDp.dp.code === task.dp.code)?.cloudKey
80
82
  devIdGroup.forEach(devId => {
81
83
  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 }))
@@ -176,6 +178,7 @@ export interface TimerSettableDp {
176
178
  stringOnMin: I18nKey
177
179
  stringOffMin: I18nKey
178
180
  cloudKey: 'lightingInfo' | 'socketInfo' | 'fanInfo' | 'plugCountDownInfo'
181
+ displayToDpValue?: (value: number) => number
179
182
  }
180
183
 
181
184
  export interface TimerPageParams {