@ledvance/ui-biz-bundle 1.0.60 → 1.0.62
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 +1 -1
- package/src/modules/history/HistoryPage.tsx +7 -2
- package/src/modules/mood/MoodPage.tsx +8 -6
- package/src/modules/scene/SceneAction.ts +17 -13
- package/src/modules/scene/ScenePage.tsx +2 -2
- package/src/modules/sleepWakeup/SleepWakeUpActions.ts +60 -50
- package/src/modules/timeSchedule/DeviceState.tsx +7 -3
- package/src/modules/timeSchedule/ManualSetting.tsx +2 -4
- package/src/modules/timeSchedule/MoodSetting.tsx +11 -8
- package/src/modules/timeSchedule/ScheduleScene.tsx +11 -3
- package/src/modules/timeSchedule/SingleLightView.tsx +5 -3
- package/src/modules/timeSchedule/TimeScheduleEditpage.tsx +10 -7
package/package.json
CHANGED
|
@@ -11,6 +11,7 @@ import Spacer from '@ledvance/base/src/components/Spacer'
|
|
|
11
11
|
import {RouteProp, useRoute} from '@react-navigation/core'
|
|
12
12
|
import { isEmpty } from 'lodash'
|
|
13
13
|
import Tag from "@ledvance/base/src/components/Tag"
|
|
14
|
+
import { exportHistoryFile } from '@ledvance/base/src/utils/common'
|
|
14
15
|
|
|
15
16
|
const cx = Utils.RatioUtils.convertX
|
|
16
17
|
|
|
@@ -77,12 +78,16 @@ const SwitchHistoryPage = () => {
|
|
|
77
78
|
})
|
|
78
79
|
}, [state.onRefresh, state.filterTags])
|
|
79
80
|
|
|
81
|
+
const downFile = () => {
|
|
82
|
+
exportHistoryFile(state.data)
|
|
83
|
+
}
|
|
84
|
+
|
|
80
85
|
return (
|
|
81
86
|
<Page
|
|
82
87
|
backText={backText || deviceInfo.name}
|
|
83
88
|
headlineText={headlineText || I18n.getLang('history_socket_headline_text')}
|
|
84
|
-
|
|
85
|
-
|
|
89
|
+
headlineIcon={res.rn_ic_download}
|
|
90
|
+
onHeadlineIconClick={downFile}
|
|
86
91
|
>
|
|
87
92
|
<View style={styles.content}>
|
|
88
93
|
<Text style={styles.titleText}>{I18n.getLang('history_contact_sensor_description_text')}</Text>
|
|
@@ -78,12 +78,14 @@ const MoodPage = () => {
|
|
|
78
78
|
setTimeout(async () => {
|
|
79
79
|
const res = await getRemoteSceneList(
|
|
80
80
|
deviceInfo.devId,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
81
|
+
{
|
|
82
|
+
isRGBWLamp: params.isRGBWLamp,
|
|
83
|
+
isRGBLamp: params.isRGBLamp,
|
|
84
|
+
isOnlyRGBLamp: params.isOnlyRGBLamp,
|
|
85
|
+
isFanLamp: params.isFanLamp,
|
|
86
|
+
isTWLamp: params.isTWLamp,
|
|
87
|
+
isDIMLamp: params.isDIMLamp,
|
|
88
|
+
},
|
|
87
89
|
isUVCFan
|
|
88
90
|
)
|
|
89
91
|
if (res.success) {
|
|
@@ -34,14 +34,18 @@ export const setRemoteSceneList: SetRemoteSceneListType = async (
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
interface LampParams{
|
|
38
|
+
isRGBWLamp?: boolean
|
|
39
|
+
isRGBLamp?: boolean
|
|
40
|
+
isOnlyRGBLamp?: boolean
|
|
41
|
+
isFanLamp?: boolean
|
|
42
|
+
isTWLamp?: boolean
|
|
43
|
+
isDIMLamp?: boolean
|
|
44
|
+
}
|
|
45
|
+
|
|
37
46
|
export async function getRemoteSceneList(
|
|
38
47
|
deviceId: string,
|
|
39
|
-
|
|
40
|
-
isRGBLamp: boolean = false,
|
|
41
|
-
isOnlyRGBLamp: boolean = false,
|
|
42
|
-
isFanLamp: boolean = false,
|
|
43
|
-
isTWLamp: boolean = false,
|
|
44
|
-
isDIMLamp: boolean = false,
|
|
48
|
+
lampParams?: LampParams,
|
|
45
49
|
isUVCFan?: boolean
|
|
46
50
|
): Promise<Result<SceneUIState[]>> {
|
|
47
51
|
const res: NativeResult<RemoteSceneInfo[]> = await getFeature(deviceId, SceneFeatureId)
|
|
@@ -50,12 +54,12 @@ export async function getRemoteSceneList(
|
|
|
50
54
|
}
|
|
51
55
|
if (!(!!res.data)) {
|
|
52
56
|
const res = await setRemoteSceneList(deviceId, getDefSceneList(
|
|
53
|
-
isRGBWLamp,
|
|
54
|
-
isRGBLamp,
|
|
55
|
-
isOnlyRGBLamp,
|
|
56
|
-
isFanLamp,
|
|
57
|
-
isTWLamp,
|
|
58
|
-
isDIMLamp,
|
|
57
|
+
lampParams?.isRGBWLamp,
|
|
58
|
+
lampParams?.isRGBLamp,
|
|
59
|
+
lampParams?.isOnlyRGBLamp,
|
|
60
|
+
lampParams?.isFanLamp,
|
|
61
|
+
lampParams?.isTWLamp,
|
|
62
|
+
lampParams?.isDIMLamp,
|
|
59
63
|
))
|
|
60
64
|
if (res.success) {
|
|
61
65
|
return getRemoteSceneList(deviceId)
|
|
@@ -64,7 +68,7 @@ export async function getRemoteSceneList(
|
|
|
64
68
|
}
|
|
65
69
|
return {
|
|
66
70
|
success: true,
|
|
67
|
-
data: res.data.map((item, index) => remoteSceneInfo2SceneUIState(item, index, isFanLamp, isUVCFan)),
|
|
71
|
+
data: res.data.map((item, index) => remoteSceneInfo2SceneUIState(item, index, !!lampParams?.isFanLamp, isUVCFan)),
|
|
68
72
|
}
|
|
69
73
|
}
|
|
70
74
|
|
|
@@ -32,7 +32,7 @@ const ScenePage = () => {
|
|
|
32
32
|
})
|
|
33
33
|
|
|
34
34
|
const getSceneList: () => void = useCallback(async () => {
|
|
35
|
-
const res = await getRemoteSceneList(deviceId,
|
|
35
|
+
const res = await getRemoteSceneList(deviceId, )
|
|
36
36
|
console.log(res)
|
|
37
37
|
if (res.success) {
|
|
38
38
|
state.scenes = res.data!!
|
|
@@ -55,7 +55,7 @@ const ScenePage = () => {
|
|
|
55
55
|
<TouchableOpacity
|
|
56
56
|
style={{ flex: 1, marginBottom: cx(15), marginHorizontal: cx(6), height: cx(100) }}
|
|
57
57
|
onPress={async () => {
|
|
58
|
-
await setScene(deviceId, item, dpCodes)
|
|
58
|
+
// await setScene(deviceId, item, dpCodes)
|
|
59
59
|
}}>
|
|
60
60
|
<ImageBackground
|
|
61
61
|
source={{ uri: item.image }}
|
|
@@ -22,37 +22,42 @@ const putFeatureFn = async (devId, featureId, data) => {
|
|
|
22
22
|
return status
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
export const useSleepPlan = (dpCodes: Record<string, string
|
|
25
|
+
export const useSleepPlan = (dpCodes: Record<string, string>, disableFeature?: boolean) => {
|
|
26
26
|
const deviceId = useDeviceId()
|
|
27
27
|
const [uiData, setUiData] = useState([] as any)
|
|
28
28
|
const [sleepPlan, setSleepPlan]: any = useDp(dpCodes.sleep_mode);
|
|
29
29
|
// 获取云端数据
|
|
30
30
|
useEffect(() => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
if (
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
31
|
+
if(disableFeature){
|
|
32
|
+
const dpData = decodeSleepString(sleepPlan)
|
|
33
|
+
setUiData(dpData)
|
|
34
|
+
}else{
|
|
35
|
+
getFeature(deviceId, sleepPlanFeatureId).then(res => {
|
|
36
|
+
if (res?.result) {
|
|
37
|
+
const data = res?.data
|
|
38
|
+
let list = data?.map(item => { return { ...item, startTime: (item?.startTime || item?.v) && JSON.parse(item?.startTime || item?.v)?.dp || '' } })
|
|
39
|
+
// 首次进入同步云端数据 (云端无数据)
|
|
40
|
+
if (!list) {
|
|
41
|
+
list = decodeSleepString(sleepPlan)
|
|
42
|
+
setSleepCloudData(list, deviceId).then()
|
|
43
|
+
setUiData(list)
|
|
44
|
+
return
|
|
45
|
+
}
|
|
46
|
+
const dpData = decodeSleepString(sleepPlan)
|
|
47
|
+
const sleepCloudData = highInTheCloudsSleepString(list)
|
|
48
|
+
// 更新
|
|
49
|
+
if (sleepCloudData?.length === dpData?.length) {
|
|
50
|
+
const list = dpData?.map((item, index) => {
|
|
51
|
+
return { ...item, name: sleepCloudData[index]?.name }
|
|
52
|
+
})
|
|
53
|
+
setSleepCloudData(list, deviceId).then()
|
|
54
|
+
setUiData(list)
|
|
55
|
+
return
|
|
56
|
+
}
|
|
57
|
+
setUiData(highInTheCloudsSleepString(list))
|
|
41
58
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
// 更新
|
|
45
|
-
if (sleepCloudData?.length === dpData?.length) {
|
|
46
|
-
const list = dpData?.map((item, index) => {
|
|
47
|
-
return { ...item, name: sleepCloudData[index]?.name }
|
|
48
|
-
})
|
|
49
|
-
setSleepCloudData(list, deviceId).then()
|
|
50
|
-
setUiData(list)
|
|
51
|
-
return
|
|
52
|
-
}
|
|
53
|
-
setUiData(highInTheCloudsSleepString(list))
|
|
54
|
-
}
|
|
55
|
-
})
|
|
59
|
+
})
|
|
60
|
+
}
|
|
56
61
|
}, [sleepPlan])
|
|
57
62
|
|
|
58
63
|
const setSleepList = async (sleepPlan: any[]) => {
|
|
@@ -83,37 +88,42 @@ export const useSleepPlan = (dpCodes: Record<string, string>) => {
|
|
|
83
88
|
return [uiData, setSleepList];
|
|
84
89
|
}
|
|
85
90
|
|
|
86
|
-
export const useWakeUpPlan = (dpCodes: Record<string, string
|
|
91
|
+
export const useWakeUpPlan = (dpCodes: Record<string, string>, disableFeature?: boolean) => {
|
|
87
92
|
const deviceId = useDeviceId()
|
|
88
93
|
const [uiData, setUiData] = useState([] as any)
|
|
89
94
|
const [wakeUpPlan, setWakeUpPlan]: any = useDp(dpCodes.wakeup_mode)
|
|
90
95
|
// 获取云端数据
|
|
91
96
|
useEffect(() => {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
if (
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
97
|
+
if(disableFeature){
|
|
98
|
+
const dpData = decodeWakeUpString(wakeUpPlan)
|
|
99
|
+
setUiData(dpData)
|
|
100
|
+
}else{
|
|
101
|
+
getFeature(deviceId, wakeUpPlanFeatureId).then(res => {
|
|
102
|
+
if (res?.result) {
|
|
103
|
+
const data = res?.data
|
|
104
|
+
let list = data?.map(item => { return { ...item, startTime: (item?.startTime || item?.v) && JSON.parse(item?.startTime || item?.v)?.dp || '' } })
|
|
105
|
+
// 首次进入同步云端数据 (云端无数据)
|
|
106
|
+
if (!list) {
|
|
107
|
+
list = decodeWakeUpString(wakeUpPlan)
|
|
108
|
+
setWakeCloudData(list, deviceId).then()
|
|
109
|
+
setUiData(list)
|
|
110
|
+
return
|
|
111
|
+
}
|
|
112
|
+
const dpData = decodeWakeUpString(wakeUpPlan)
|
|
113
|
+
const wakeCloudData = highInTheCloudsWakeString(list)
|
|
114
|
+
// 更新
|
|
115
|
+
if (wakeCloudData?.length === dpData?.length) {
|
|
116
|
+
const list = dpData?.map((item, index) => {
|
|
117
|
+
return { ...item, name: wakeCloudData[index]?.name }
|
|
118
|
+
})
|
|
119
|
+
setWakeCloudData(list, deviceId).then()
|
|
120
|
+
setUiData(list)
|
|
121
|
+
return
|
|
122
|
+
}
|
|
123
|
+
setUiData(highInTheCloudsWakeString(list))
|
|
102
124
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
// 更新
|
|
106
|
-
if (wakeCloudData?.length === dpData?.length) {
|
|
107
|
-
const list = dpData?.map((item, index) => {
|
|
108
|
-
return { ...item, name: wakeCloudData[index]?.name }
|
|
109
|
-
})
|
|
110
|
-
setWakeCloudData(list, deviceId).then()
|
|
111
|
-
setUiData(list)
|
|
112
|
-
return
|
|
113
|
-
}
|
|
114
|
-
setUiData(highInTheCloudsWakeString(list))
|
|
115
|
-
}
|
|
116
|
-
})
|
|
125
|
+
})
|
|
126
|
+
}
|
|
117
127
|
}, [wakeUpPlan])
|
|
118
128
|
|
|
119
129
|
const setWakeUpList = async (wakeUpPlan) => {
|
|
@@ -75,12 +75,16 @@ const DeviceState = (props: DeviceStateProps) => {
|
|
|
75
75
|
<Text style={{
|
|
76
76
|
color: '#FF9500',
|
|
77
77
|
marginLeft: cx(5),
|
|
78
|
-
}}>{I18n.getLang('
|
|
78
|
+
}}>{I18n.getLang('timeschedule_add_schedule_devicestate_sec_warning_text')}</Text>
|
|
79
79
|
</View> :
|
|
80
80
|
<MoodSetting
|
|
81
|
+
isOnlyRGBLamp={props.isOnlyRGBLamp}
|
|
82
|
+
isDIMLamp={props.isDIMLamp}
|
|
83
|
+
isRGBLamp={props.isRGBLamp}
|
|
84
|
+
isRGBWLamp={props.isRGBWLamp}
|
|
85
|
+
isTWLamp={props.isTWLamp}
|
|
86
|
+
isFanLamp={props.isFanLamp}
|
|
81
87
|
actionScene={props.actionScene}
|
|
82
|
-
dpCodes={props.dpCodes}
|
|
83
|
-
dps={props.dps}
|
|
84
88
|
scheduleItem={props.scheduleItem}
|
|
85
89
|
setSendDps={props.setSendDps}
|
|
86
90
|
changeSkillEnable={props.changeSkillEnable}/>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react'
|
|
1
|
+
import React, {memo} from 'react'
|
|
2
2
|
import { View } from 'react-native'
|
|
3
3
|
import SingleLightView from './SingleLightView'
|
|
4
4
|
import { ScheduleItemDp } from './TimeScheduleEditpage'
|
|
@@ -35,9 +35,7 @@ const ManualSetting = (props: ManualSettingProps) => {
|
|
|
35
35
|
return (
|
|
36
36
|
<MixLightView
|
|
37
37
|
mixActions={state.mixActions}
|
|
38
|
-
dpCodes={props.dpCodes}
|
|
39
38
|
setSendDps={props.setSendDps}
|
|
40
|
-
scheduleItem={props.scheduleItem}
|
|
41
39
|
/>
|
|
42
40
|
)
|
|
43
41
|
}
|
|
@@ -75,4 +73,4 @@ const ManualSetting = (props: ManualSettingProps) => {
|
|
|
75
73
|
)
|
|
76
74
|
}
|
|
77
75
|
|
|
78
|
-
export default ManualSetting
|
|
76
|
+
export default memo(ManualSetting)
|
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { ScheduleItemDp } from './TimeScheduleEditpage'
|
|
1
|
+
import React, { memo } from 'react'
|
|
3
2
|
import ScheduleScene from './ScheduleScene'
|
|
3
|
+
import { JudgeTimeScheduleProps } from './TimeScheduleBean'
|
|
4
4
|
|
|
5
|
-
interface MoodSettingProps {
|
|
5
|
+
interface MoodSettingProps extends JudgeTimeScheduleProps {
|
|
6
6
|
actionScene: any
|
|
7
7
|
scheduleItem: any
|
|
8
|
-
dps: ScheduleItemDp[]
|
|
9
|
-
dpCodes: Record<string, string>
|
|
10
8
|
setSendDps: (actions: any, type: string) => void
|
|
11
9
|
changeSkillEnable: (dpId: string, enable: boolean) => void
|
|
12
10
|
}
|
|
13
11
|
|
|
14
12
|
const MoodSetting = (props: MoodSettingProps) => {
|
|
15
|
-
const {
|
|
13
|
+
const { setSendDps } = props
|
|
16
14
|
|
|
17
15
|
return (
|
|
18
16
|
<ScheduleScene
|
|
19
|
-
|
|
17
|
+
isOnlyRGBLamp={props.isOnlyRGBLamp}
|
|
18
|
+
isDIMLamp={props.isDIMLamp}
|
|
19
|
+
isRGBLamp={props.isRGBLamp}
|
|
20
|
+
isRGBWLamp={props.isRGBWLamp}
|
|
21
|
+
isTWLamp={props.isTWLamp}
|
|
22
|
+
isFanLamp={props.isFanLamp}
|
|
20
23
|
scene={props.actionScene}
|
|
21
24
|
setScene={s => {
|
|
22
25
|
setSendDps(s, 'actionScene')
|
|
@@ -24,4 +27,4 @@ const MoodSetting = (props: MoodSettingProps) => {
|
|
|
24
27
|
)
|
|
25
28
|
}
|
|
26
29
|
|
|
27
|
-
export default MoodSetting
|
|
30
|
+
export default memo(MoodSetting)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useCallback, useEffect } from 'react'
|
|
2
2
|
import I18n from '@ledvance/base/src/i18n'
|
|
3
3
|
import { getRemoteSceneList } from '../scene/SceneAction'
|
|
4
|
-
import { useDeviceInfo } from '@ledvance/base/src/models/modules/NativePropsSlice'
|
|
4
|
+
import { isUVCFanDevice, useDeviceInfo } from '@ledvance/base/src/models/modules/NativePropsSlice'
|
|
5
5
|
import { useReactive } from 'ahooks'
|
|
6
6
|
import { ScenePageUIState, SceneUIState } from '../scene/SceneInfo'
|
|
7
7
|
import res from '@ledvance/base/src/res'
|
|
@@ -22,8 +22,9 @@ interface MoodUIState extends ScenePageUIState {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
const ScheduleScene = ({ scene, setScene,
|
|
25
|
+
const ScheduleScene = ({ scene, setScene, isOnlyRGBLamp, isDIMLamp, isRGBLamp, isRGBWLamp, isTWLamp, isFanLamp }) => {
|
|
26
26
|
const deviceInfo = useDeviceInfo()
|
|
27
|
+
const isUVCFan = isUVCFanDevice()
|
|
27
28
|
const state = useReactive<MoodUIState>({
|
|
28
29
|
currentScene: undefined,
|
|
29
30
|
staticTagChecked: true,
|
|
@@ -34,7 +35,14 @@ const ScheduleScene = ({ scene, setScene, dpCodes }) => {
|
|
|
34
35
|
})
|
|
35
36
|
|
|
36
37
|
const getSceneList = useCallback(async () => {
|
|
37
|
-
const res = await getRemoteSceneList(deviceInfo.devId,
|
|
38
|
+
const res = await getRemoteSceneList(deviceInfo.devId,{
|
|
39
|
+
isOnlyRGBLamp,
|
|
40
|
+
isDIMLamp,
|
|
41
|
+
isRGBLamp,
|
|
42
|
+
isRGBWLamp,
|
|
43
|
+
isTWLamp,
|
|
44
|
+
isFanLamp
|
|
45
|
+
}, isUVCFan)
|
|
38
46
|
if (res.success) {
|
|
39
47
|
state.scenes = res.data || []
|
|
40
48
|
state.currentScene = isEmpty(scene) ? state.scenes[0] : scene
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useCallback } from 'react'
|
|
1
|
+
import React, { useCallback, memo } from 'react'
|
|
2
2
|
import { View } from 'react-native'
|
|
3
3
|
import LdvSwitch from '@ledvance/base/src/components/ldvSwitch'
|
|
4
4
|
import { Utils } from 'tuya-panel-kit'
|
|
@@ -26,7 +26,7 @@ interface SingleLightViewProps extends JudgeTimeScheduleProps {
|
|
|
26
26
|
setEnable: (dpId: string, enable: boolean) => void
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
const SingleLightView = (props: SingleLightViewProps) =>{
|
|
30
30
|
const {
|
|
31
31
|
dp,
|
|
32
32
|
setSendDps,
|
|
@@ -187,4 +187,6 @@ export default function SingleLightView(props: SingleLightViewProps) {
|
|
|
187
187
|
}
|
|
188
188
|
</Card>
|
|
189
189
|
)
|
|
190
|
-
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export default memo(SingleLightView)
|
|
@@ -12,7 +12,7 @@ import Spacer from '@ledvance/base/src/components/Spacer'
|
|
|
12
12
|
import DeleteButton from '@ledvance/base/src/components/DeleteButton'
|
|
13
13
|
import { loopText, toFixed } from '@ledvance/base/src/utils/common'
|
|
14
14
|
import { NativeApi } from '@ledvance/base/src/api/native'
|
|
15
|
-
import { useDeviceId } from '@ledvance/base/src/models/modules/NativePropsSlice'
|
|
15
|
+
import { isUVCFanDevice, useDeviceId } from '@ledvance/base/src/models/modules/NativePropsSlice'
|
|
16
16
|
import res from '@ledvance/base/src/res'
|
|
17
17
|
import { useReactive } from 'ahooks'
|
|
18
18
|
import { dpItem, TimeSchedulePageRouteParams } from './TimeSchedulePage'
|
|
@@ -43,6 +43,7 @@ const TimeScheduleEditPage = () => {
|
|
|
43
43
|
const navigation = useNavigation()
|
|
44
44
|
const devId = useDeviceId()
|
|
45
45
|
const route = useRoute()
|
|
46
|
+
const isUVCFan = isUVCFanDevice()
|
|
46
47
|
const props = cloneDeep(route.params) as TimeScheduleEditPageParams
|
|
47
48
|
const { scheduleItem, dps, reloadData, deleteDialog, dpCodes } = props
|
|
48
49
|
const state = useReactive({
|
|
@@ -135,7 +136,7 @@ const TimeScheduleEditPage = () => {
|
|
|
135
136
|
}
|
|
136
137
|
|
|
137
138
|
if (scheduleItem.dps[dpCodes.scene_data] !== undefined) {
|
|
138
|
-
state.actionScene = sencePp2Obj(scheduleItem.dps[dpCodes.scene_data], !!props.isFanLamp)
|
|
139
|
+
state.actionScene = sencePp2Obj(scheduleItem.dps[dpCodes.scene_data], !!props.isFanLamp, isUVCFan)
|
|
139
140
|
state.isManual = false
|
|
140
141
|
}
|
|
141
142
|
if (scheduleItem.dps[dpCodes.mix_light_scene] !== undefined) {
|
|
@@ -179,7 +180,7 @@ const TimeScheduleEditPage = () => {
|
|
|
179
180
|
!isEqual(scheduleItem?.time, [state.hour, state.minute].join(':')),
|
|
180
181
|
!isEqual(scheduleItem?.loops, state.loop.join('')),
|
|
181
182
|
!isEqual(!!scheduleItem?.isAppPush, state.isNotification),
|
|
182
|
-
!isEqual(scheduleItem?.dps, getSendDps()),
|
|
183
|
+
// !isEqual(scheduleItem?.dps, getSendDps()),
|
|
183
184
|
].some(e => e)
|
|
184
185
|
}
|
|
185
186
|
|
|
@@ -348,7 +349,7 @@ const TimeScheduleEditPage = () => {
|
|
|
348
349
|
[dpCodes.scene_data]: senceObj2Dp({
|
|
349
350
|
id: Number(state?.actionScene?.id),
|
|
350
351
|
nodes: state?.actionScene?.nodes,
|
|
351
|
-
}, !!props.isFanLamp),
|
|
352
|
+
}, !!props.isFanLamp, isUVCFan),
|
|
352
353
|
[dpCodes.work_mode]: SCENE,
|
|
353
354
|
}
|
|
354
355
|
return props.isFanLamp ? {
|
|
@@ -422,14 +423,14 @@ const TimeScheduleEditPage = () => {
|
|
|
422
423
|
return !!state.selectedSkill.length
|
|
423
424
|
}
|
|
424
425
|
|
|
425
|
-
const changeSkillEnable = (dpId: string, enable: boolean) => {
|
|
426
|
+
const changeSkillEnable = useCallback((dpId: string, enable: boolean) => {
|
|
426
427
|
state.selectedSkill = state.selectedSkill.map((skill) => {
|
|
427
428
|
if (dpId === skill.dpId) {
|
|
428
429
|
skill.enable = enable
|
|
429
430
|
}
|
|
430
431
|
return skill
|
|
431
432
|
})
|
|
432
|
-
}
|
|
433
|
+
}, [state.selectedSkill])
|
|
433
434
|
|
|
434
435
|
const showClearIcon = () => {
|
|
435
436
|
return dps.length > 1 && !props.isMixRGBWLamp
|
|
@@ -522,7 +523,9 @@ const TimeScheduleEditPage = () => {
|
|
|
522
523
|
selectedDps={state.selectedSkill}
|
|
523
524
|
scheduleItem={scheduleItem}
|
|
524
525
|
isManual={state.isManual}
|
|
525
|
-
setIsManual={(v) =>
|
|
526
|
+
setIsManual={useCallback((v) => {
|
|
527
|
+
state.isManual = v
|
|
528
|
+
}, [])}
|
|
526
529
|
setSendDps={setSendDps}
|
|
527
530
|
changeSkillEnable={changeSkillEnable}
|
|
528
531
|
isDIMLamp={props.isDIMLamp}
|