@ledvance/base 1.1.21 → 1.1.23

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 (51) hide show
  1. package/package.json +1 -1
  2. package/src/components/ColorTempAdjustView.tsx +2 -1
  3. package/src/components/FanAdjustView.tsx +1 -1
  4. package/src/components/LinearGradientLine.tsx +5 -6
  5. package/src/components/Page.tsx +20 -7
  6. package/src/i18n/strings.ts +11369 -10977
  7. package/src/models/modules/NativePropsSlice.tsx +13 -3
  8. package/src/res/cash.png +0 -0
  9. package/src/res/cash@2x.png +0 -0
  10. package/src/res/cash@3x.png +0 -0
  11. package/src/res/componentsIOsButtonsButtonAdd.png +0 -0
  12. package/src/res/componentsIOsButtonsButtonAdd@2x.png +0 -0
  13. package/src/res/componentsIOsButtonsButtonAdd@3x.png +0 -0
  14. package/src/res/iconsMaterialOutlinedArrowsNavArrowForwardIos.png +0 -0
  15. package/src/res/iconsMaterialOutlinedArrowsNavArrowForwardIos@2x.png +0 -0
  16. package/src/res/iconsMaterialOutlinedArrowsNavArrowForwardIos@3x.png +0 -0
  17. package/src/res/iconsMaterialOutlinedArrowsNavCheck.png +0 -0
  18. package/src/res/iconsMaterialOutlinedArrowsNavCheck@2x.png +0 -0
  19. package/src/res/iconsMaterialOutlinedArrowsNavCheck@3x.png +0 -0
  20. package/src/res/iconsMaterialOutlinedCalendarCalendarToday.png +0 -0
  21. package/src/res/iconsMaterialOutlinedCalendarCalendarToday@2x.png +0 -0
  22. package/src/res/iconsMaterialOutlinedCalendarCalendarToday@3x.png +0 -0
  23. package/src/res/iconsMaterialOutlinedCommunicationInfo.png +0 -0
  24. package/src/res/iconsMaterialOutlinedCommunicationInfo@2x.png +0 -0
  25. package/src/res/iconsMaterialOutlinedCommunicationInfo@3x.png +0 -0
  26. package/src/res/iconsMaterialOutlinedEditorFileDownload.png +0 -0
  27. package/src/res/iconsMaterialOutlinedEditorFileDownload@2x.png +0 -0
  28. package/src/res/iconsMaterialOutlinedEditorFileDownload@3x.png +0 -0
  29. package/src/res/iconsMaterialOutlinedEditorInventory.png +0 -0
  30. package/src/res/iconsMaterialOutlinedEditorInventory@2x.png +0 -0
  31. package/src/res/iconsMaterialOutlinedEditorInventory@3x.png +0 -0
  32. package/src/res/iconsMaterialOutlinedOtherBarChart.png +0 -0
  33. package/src/res/iconsMaterialOutlinedOtherBarChart@2x.png +0 -0
  34. package/src/res/iconsMaterialOutlinedOtherBarChart@3x.png +0 -0
  35. package/src/res/iconsMaterialOutlinedOtherEnergySavingsLeaf.png +0 -0
  36. package/src/res/iconsMaterialOutlinedOtherEnergySavingsLeaf@2x.png +0 -0
  37. package/src/res/iconsMaterialOutlinedOtherEnergySavingsLeaf@3x.png +0 -0
  38. package/src/res/iconsMaterialOutlinedTimeAccessTime.png +0 -0
  39. package/src/res/iconsMaterialOutlinedTimeAccessTime@2x.png +0 -0
  40. package/src/res/iconsMaterialOutlinedTimeAccessTime@3x.png +0 -0
  41. package/src/res/illustrationsFeaturesLogs.png +0 -0
  42. package/src/res/illustrationsFeaturesLogs@2x.png +0 -0
  43. package/src/res/illustrationsFeaturesLogs@3x.png +0 -0
  44. package/src/res/illustrationsHomeRoutines.png +0 -0
  45. package/src/res/illustrationsHomeRoutines@2x.png +0 -0
  46. package/src/res/illustrationsHomeRoutines@3x.png +0 -0
  47. package/src/res/index.ts +26 -10
  48. package/src/res/materialiconsOutlinedArrowsNavWarningAmber.png +0 -0
  49. package/src/res/materialiconsOutlinedArrowsNavWarningAmber@2x.png +0 -0
  50. package/src/res/materialiconsOutlinedArrowsNavWarningAmber@3x.png +0 -0
  51. package/src/utils/Support.ts +24 -0
@@ -12,7 +12,7 @@ export interface NativeProps {
12
12
  familyName: string
13
13
  deviceInfo: DeviceInfo
14
14
  uaGroupInfo: UAGroupInfo
15
- timeSchedule?: symbol
15
+ timeSchedule?: boolean
16
16
  energieverbrauch?: object
17
17
  }
18
18
 
@@ -42,7 +42,7 @@ const initialState: NativeProps = {
42
42
  dps: {},
43
43
  config: {},
44
44
  },
45
- timeSchedule: Symbol(),
45
+ timeSchedule: false,
46
46
  energieverbrauch: {},
47
47
  }
48
48
 
@@ -51,6 +51,10 @@ const productList = [
51
51
  'rcqe1i17x0vrvws7',
52
52
  ]
53
53
 
54
+ const fanProductList = [
55
+ "urcqn70htlshvigb"
56
+ ]
57
+
54
58
  const nativePropsSlice = createSlice({
55
59
  name: 'ldvModules',
56
60
  initialState: initialState,
@@ -179,7 +183,7 @@ const useDeviceInfo: () => DevInfo<DpState> = () => {
179
183
  return useSelector(state => state.devInfo)
180
184
  }
181
185
 
182
- const useTimeSchedule = (): [v: symbol | undefined, f: any] => {
186
+ const useTimeSchedule = (): [v: boolean | undefined, f: any] => {
183
187
  const dps = useSelector(store => store.ldvModules.timeSchedule)
184
188
  const dispatch = useDispatch()
185
189
  const setTimeScheduleFn = (value: Symbol) => {
@@ -247,6 +251,12 @@ export function useGroupConfigFeature<GC, GCPT extends { [K in keyof GC]: GC[K]
247
251
  return [groupConfig[key] as GCPT, setGroupConfigFeature]
248
252
  }
249
253
 
254
+ export const useFanMaxSpeed = () =>{
255
+ const {productId} = useDeviceInfo()
256
+ const maxSpeed = fanProductList.includes(productId) ? 20 : 3
257
+ return maxSpeed
258
+ }
259
+
250
260
  export const ldvModules = nativePropsSlice.reducer
251
261
 
252
262
  export const {
Binary file
Binary file
Binary file
package/src/res/index.ts CHANGED
@@ -7,16 +7,39 @@ export default {
7
7
  ldv_timer_empty: 'timer_empty',
8
8
  ldv_right_arrow: 'arrow',
9
9
  ldv_list_select: 'list_select',
10
+ switch_1: 'switch_1',
11
+ switch_2: 'switch_2',
12
+ switch_3: 'switch_3',
13
+ switch_4: 'switch_usb',
14
+ ic_cancel: 'ic_cancel',
15
+ ic_more: 'ic_more',
16
+ device_panel_timer_add: require('./materialiconsOutlinedArrowsNavAddBox.png'),
17
+ device_panel_schedule_alert: 'device_panel_schedule_alert',
18
+ device_panel_schedule_add: 'device_panel_schedule_add',
19
+ ic_arrows_nav_clear: require('./materialiconsFilledCancel.png'),
20
+ ic_info: 'ic_info',
21
+ ic_warning_amber: require('./materialiconsOutlinedArrowsNavWarningAmber.png'),
10
22
  ic_check: 'ic_check',
11
- ic_uncheck: 'ic_uncheck',
23
+ ic_uncheck: require('./componentsIOsButtonsButtonAdd.png'),
24
+ rn_ic_download: 'rn_ic_download',
25
+ scheduleEmpty: require('./illustrationsHomeRoutines.png'),
26
+ summary_icon1: require('./iconsMaterialOutlinedCalendarCalendarToday.png'),
27
+ summary_icon2: require('./iconsMaterialOutlinedTimeAccessTime.png'),
28
+ summary_icon3: require('./iconsMaterialOutlinedEditorInventory.png'),
29
+ energy_consumption_right: require('./iconsMaterialOutlinedArrowsNavArrowForwardIos.png'),
30
+ energy_consumption_chart: require('./iconsMaterialOutlinedOtherBarChart.png'),
31
+ energy_consumption_cash: require('./cash.png'),
32
+ energy_consumption_greenery: require('./iconsMaterialOutlinedOtherEnergySavingsLeaf.png'),
33
+ app_music_check: require('./iconsMaterialOutlinedArrowsNavCheck.png'),
34
+ co2Icon: require('./iconsMaterialOutlinedCommunicationInfo.png'),
35
+ download_icon: require('./iconsMaterialOutlinedEditorFileDownload.png'),
36
+ energy_consumption_empty: require('./illustrationsFeaturesLogs.png'),
12
37
  rhythm_icon1: 'rhythm_icon1',
13
38
  rhythm_icon2: 'rhythm_icon2',
14
39
  rhythm_icon3: 'rhythm_icon3',
15
40
  rhythm_icon4: 'rhythm_icon4',
16
41
  color_temperature_wheel: 'color_temperature_wheel',
17
42
  color_wheel: 'color_wheel',
18
- ic_more: 'ic_more',
19
- ic_cancel: 'ic_cancel',
20
43
  scene_goodnight: 'scene_goodnight',
21
44
  scene_reading: 'scene_reading',
22
45
  scene_work: 'scene_work',
@@ -27,13 +50,6 @@ export default {
27
50
  add: 'add',
28
51
  delete: 'delete',
29
52
  icon_edit_scene: 'icon_edit_scene',
30
- device_panel_timer_add: require('./materialiconsOutlinedArrowsNavAddBox.png'),
31
- device_panel_schedule_add: 'device_panel_schedule_add',
32
- device_panel_schedule_alert: 'device_panel_schedule_alert',
33
- ic_arrows_nav_clear: require('./materialiconsFilledCancel.png'),
34
- ic_info: 'ic_info',
35
- ic_warning_amber: 'ic_warning_amber',
36
- rn_ic_download: 'rn_ic_download',
37
53
  light_on: require('./light_on.png'),
38
54
  light_off: require('./light_off.png'),
39
55
  }
@@ -1,3 +1,4 @@
1
+
1
2
  // 判断是否是plug
2
3
  export const isPlug = (dpCodes: Record<string, string>) => {
3
4
  return !!dpCodes.switch_1
@@ -62,6 +63,17 @@ export const isTWLamp = (dpCodes: Record<string, string>) => {
62
63
  )
63
64
  }
64
65
 
66
+ // 支持调节: 色温+ 温度
67
+ export const isFanLamp = (dpCodes: Record<string, string>) => {
68
+ return !!(
69
+ !dpCodes.mix_rgbcw &&
70
+ !dpCodes.colour_data &&
71
+ dpCodes.temp_value &&
72
+ dpCodes.bright_value &&
73
+ dpCodes.fan_speed
74
+ )
75
+ }
76
+
65
77
  // 支持调节:单一色温亮度
66
78
  export const isDIMLamp = (dpCodes: Record<string, string>) => {
67
79
  return !!(
@@ -82,4 +94,16 @@ export const isGARDOT = (dpCodes: Record<string, string>) => {
82
94
  dpCodes.countdown &&
83
95
  dpCodes.control_data
84
96
  )
97
+ }
98
+
99
+ export const isSupportColor = (dpCodes: Record<string, string>) => {
100
+ return !!(dpCodes.colour_data)
101
+ }
102
+
103
+ export const isSupportTemperature = (dpCodes: Record<string, string>) => {
104
+ return !!(dpCodes.temp_value)
105
+ }
106
+
107
+ export const isSupportBrightness = (dpCodes: Record<string, string>) => {
108
+ return !!(dpCodes.bright_value)
85
109
  }