@ledvance/group-ui-biz-bundle 1.0.53 → 1.0.55

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.53",
7
+ "version": "1.0.55",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
10
  "@ledvance/base": "^1.x",
@@ -8,15 +8,9 @@ import { Utils } from '@tuya/tuya-panel-lamp-sdk'
8
8
  import { useEffect, useState } from "react";
9
9
  import { getGlobalParamsDp } from "@ledvance/base/src/utils/common";
10
10
  import { Result } from "@ledvance/base/src/models/modules/Result";
11
+ import { FlagPageProps } from "@ledvance/group-ui-biz-bundle/src/modules/flags/FlagPage";
11
12
  const { nToHS, toFixed } = Utils
12
13
 
13
- interface LightType {
14
- isStringLight?: boolean
15
- isStripLight?: boolean
16
- isMixLight?: boolean
17
- isCeilingLight?: boolean
18
- }
19
-
20
14
  interface FlagMode {
21
15
  flagMode: boolean
22
16
  flagId?: number
@@ -28,6 +22,7 @@ interface FlagDataType {
28
22
 
29
23
  export interface FlagConfigType {
30
24
  switch_led: boolean
25
+ switch: boolean
31
26
  colour_switch: boolean
32
27
  white_switch: boolean
33
28
  work_mode: WorkMode
@@ -67,15 +62,21 @@ export function useRgbicWorkMode(): [WorkMode, (value: WorkMode) => Promise<Resu
67
62
 
68
63
  const featureId = 'Flag_data'
69
64
 
70
- type UseFlagType = (params: LightType) => [FlagDataType | undefined, (flagData: FlagDataType) => Promise<any>]
65
+ type UseFlagType = (params: FlagPageProps) => [FlagDataType | undefined, (flagData: FlagDataType) => Promise<any>]
71
66
 
72
67
  export const useFlag: UseFlagType = (params) => {
73
68
  return useFeatureHook<FlagConfigType, FlagDataType | undefined>('flagSceneConfig', undefined, undefined, (flagData) =>{
74
69
  if(flagData?.flag){
75
70
  const dps = {}
76
71
  const { flag } = flagData
77
- if (!(params.isStringLight || params.isCeilingLight)){
78
- dps[getGlobalParamsDp('scene_data')] = obj2Dp(flag, params)
72
+ if (!(params.isStripLight || params.isCeilingLight)){
73
+ const moodDp = obj2Dp(flag, params)
74
+ if (params.isStringLight){
75
+ dps[getGlobalParamsDp('rgbic_linerlight_scene')] = moodDp
76
+ }else{
77
+ dps[getGlobalParamsDp('scene_data')] = moodDp
78
+ }
79
+ dps[getGlobalParamsDp('work_mode')] = WorkMode.Scene
79
80
  }else{
80
81
  const paintHex = drawToolFormat({
81
82
  adjustCode: 3,
@@ -101,7 +102,7 @@ export const useFlag: UseFlagType = (params) => {
101
102
  dps[getGlobalParamsDp('work_mode')] = WorkMode.White
102
103
  dps[getGlobalParamsDp('rgbic_work_mode')] = WorkMode.Colour
103
104
  }
104
- dps[getGlobalParamsDp('switch_led')] = true
105
+ dps[params.switchLedCode] = true
105
106
  return dps
106
107
  }
107
108
  },
@@ -109,7 +110,7 @@ export const useFlag: UseFlagType = (params) => {
109
110
  if (flagData?.flag){
110
111
  const config = {}
111
112
  config['work_mode'] = params.isStripLight ? WorkMode.Colour : WorkMode.Scene
112
- config['switch_led'] = true
113
+ config[params.isMatterLight ? 'switch' : 'switch_led'] = true
113
114
  if (params.isCeilingLight){
114
115
  config['white_switch'] = true
115
116
  config['colour_switch'] = true
@@ -26,6 +26,7 @@ export interface FlagPageProps {
26
26
  isStripLight?: boolean
27
27
  isStringLight?: boolean
28
28
  isCeilingLight?: boolean
29
+ isMatterLight?: boolean
29
30
  isSupportTemperature?: boolean
30
31
  isSupportBrightness?: boolean
31
32
  switchLedCode: string
@@ -21,7 +21,7 @@ export const defMixDeviceData = {
21
21
 
22
22
  export const defStripDeviceData = {
23
23
  ...defDeviceData,
24
- activeKey: 0,
24
+ activeKey: 1,
25
25
  colorDiskActiveKey: 0,
26
26
  colors: ColorList[0],
27
27
  };
@@ -33,11 +33,6 @@ export const defCeilingLihtDeviceData = {
33
33
  }
34
34
 
35
35
  export const addTimeSchedule = async (props: IAddSingleTime) => {
36
- console.log({
37
- ...props,
38
- bizType: '1',
39
- category: 'category'
40
- }, '< --- schedule --- >')
41
36
  try {
42
37
  const res = await commonApi.timerApi.addSingleTimer({
43
38
  ...props,
@@ -125,7 +125,6 @@ const TimeScheduleDetailPage = () => {
125
125
  getRemoteMoodList(uaGroupInfo.tyGroupId.toString(), props).then(res => {
126
126
  if (res.success && Array.isArray(res.data)) {
127
127
  state.moods = cloneDeep(res.data);
128
- console.log(state.moods, '< --- moods')
129
128
  setMoods(cloneDeep(res.data));
130
129
  if (!state.mood) state.mood = cloneDeep(res.data[0]);
131
130
  }
@@ -495,6 +494,7 @@ const TimeScheduleDetailPage = () => {
495
494
  const res = await props.modDeleteTimeSchedule('del', state.timeSchedule, state.timeSchedule.id.toString());
496
495
  state.loading = false;
497
496
  if (res.success) {
497
+ props.refreshFn()
498
498
  navigation.goBack();
499
499
  }
500
500
  },
@@ -234,7 +234,8 @@ function ManualSettings(props: ManualSettingProps) {
234
234
  onActiveKeyChange={(activekey) => {
235
235
  state.deviceData = {
236
236
  ...state.deviceData,
237
- activeKey: Number(activekey)
237
+ activeKey: Number(activekey),
238
+ isColorMode: !(Number(activekey) === 0)
238
239
  }
239
240
  state.manualFlag = Symbol()
240
241
  }}