@ledvance/ui-biz-bundle 1.1.77 → 1.1.78
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/flags/FlagEditPage.tsx +6 -2
- package/src/newModules/fixedTime/FixedTimeActions.ts +2 -2
- package/src/newModules/fixedTime/FixedTimeDetailPage.tsx +18 -12
- package/src/newModules/randomTime/RandomTimeActions.ts +2 -2
- package/src/newModules/randomTime/RandomTimeDetailPage.tsx +19 -12
- package/src/newModules/remoteControl/RemoteControlPage.tsx +21 -3
- package/src/newModules/sleepWakeUp/SleepWakeUpActions.ts +2 -2
- package/src/newModules/timeSchedule/TimeScheduleActions.ts +2 -1
- package/src/newModules/timeSchedule/TimeScheduleDetailPage.tsx +11 -9
- package/src/newModules/timeSchedule/TimeSchedulePage.tsx +1 -1
- package/src/newModules/timeSchedule/components/ManuaSettings.tsx +2 -2
package/package.json
CHANGED
|
@@ -56,11 +56,15 @@ const FlagEditPage = () => {
|
|
|
56
56
|
}, [state.currentNode, state.currentWhiteNode])
|
|
57
57
|
|
|
58
58
|
useUpdateEffect(() =>{
|
|
59
|
-
state.
|
|
59
|
+
if (state.colorPaintBucketIdx < state.mood.colors.length) {
|
|
60
|
+
state.currentNode = state.mood.colors[state.colorPaintBucketIdx]
|
|
61
|
+
}
|
|
60
62
|
}, [JSON.stringify(state.mood.colors), state.colorPaintBucketIdx])
|
|
61
63
|
|
|
62
64
|
useUpdateEffect(() =>{
|
|
63
|
-
state.
|
|
65
|
+
if (state.whitePaintBucketIdx < state.mood.whiteColors.length) {
|
|
66
|
+
state.currentWhiteNode = state.mood.whiteColors[state.whitePaintBucketIdx]
|
|
67
|
+
}
|
|
64
68
|
}, [JSON.stringify(state.mood.whiteColors), state.whitePaintBucketIdx])
|
|
65
69
|
|
|
66
70
|
const checkMoodDataChanged = useMemo(() =>{
|
|
@@ -101,7 +101,7 @@ export const useFixedTime: UseFixedTimeType = (dpKey, isPlug, disableFeature) =>
|
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
})
|
|
104
|
-
},
|
|
104
|
+
}, 200)
|
|
105
105
|
|
|
106
106
|
return () => clearTimeout(fixedTimer)
|
|
107
107
|
}, [fixedTimeDp])
|
|
@@ -197,7 +197,7 @@ const fixedTimeDp2Obj = (fixedDp: string, isPlug?: boolean) => {
|
|
|
197
197
|
brightness,
|
|
198
198
|
temperature
|
|
199
199
|
},
|
|
200
|
-
isColorMode: !!(h
|
|
200
|
+
isColorMode: !!(h !== 0 || s !== 0 || v !== 0)
|
|
201
201
|
}
|
|
202
202
|
})
|
|
203
203
|
return {
|
|
@@ -38,15 +38,21 @@ const FixedTimeDetailPage = () => {
|
|
|
38
38
|
const is24Hour = useSystemTimeFormate()
|
|
39
39
|
const state = useReactive({
|
|
40
40
|
loading: false,
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
fixedTime: cloneDeep(params.scheduleItem),
|
|
42
|
+
initFixedTime: cloneDeep(params.scheduleItem)
|
|
43
43
|
})
|
|
44
44
|
|
|
45
45
|
useEffect(() => {
|
|
46
46
|
if (!params.isPlug && state.fixedTime.color) {
|
|
47
47
|
const { brightness, temperature, h, s, v } = state.fixedTime.color
|
|
48
48
|
const isColor = brightness === 0 && temperature === 0 && (h !== 0 || s !== 0 || v !== 0)
|
|
49
|
-
|
|
49
|
+
if (isColor) {
|
|
50
|
+
state.fixedTime.color.brightness = 100;
|
|
51
|
+
} else {
|
|
52
|
+
state.fixedTime.color.s = 100;
|
|
53
|
+
state.fixedTime.color.v = 100;
|
|
54
|
+
}
|
|
55
|
+
state.initFixedTime = cloneDeep(state.fixedTime)
|
|
50
56
|
}
|
|
51
57
|
}, [])
|
|
52
58
|
|
|
@@ -66,8 +72,8 @@ const FixedTimeDetailPage = () => {
|
|
|
66
72
|
}, [JSON.stringify(state.fixedTime)])
|
|
67
73
|
|
|
68
74
|
const checkItemChanged = useMemo(() =>{
|
|
69
|
-
return isEqual(state.fixedTime,
|
|
70
|
-
}, [
|
|
75
|
+
return isEqual(state.fixedTime, state.initFixedTime)
|
|
76
|
+
}, [state.initFixedTime, JSON.stringify(state.fixedTime)])
|
|
71
77
|
|
|
72
78
|
const canSubmit = useMemo(() => {
|
|
73
79
|
return state.fixedTime.name?.length > 0 && state.fixedTime.name?.length < 33 && !checkItemChanged && inRangeTime && state.fixedTime.channel !== undefined
|
|
@@ -91,11 +97,11 @@ const FixedTimeDetailPage = () => {
|
|
|
91
97
|
}
|
|
92
98
|
if (!params.isPlug && state.fixedTime.color) {
|
|
93
99
|
editFixedTime.color = {
|
|
94
|
-
h: state.isColorMode ? state.fixedTime.color?.h : 0,
|
|
95
|
-
s: state.isColorMode ? state.fixedTime.color?.s : 0,
|
|
96
|
-
v: state.isColorMode ? state.fixedTime.color?.v : 0,
|
|
97
|
-
temperature: state.isColorMode ? 0 : state.fixedTime.color?.temperature,
|
|
98
|
-
brightness: state.isColorMode ? 0 : state.fixedTime.color?.brightness
|
|
100
|
+
h: state.fixedTime.isColorMode ? state.fixedTime.color?.h : 0,
|
|
101
|
+
s: state.fixedTime.isColorMode ? state.fixedTime.color?.s : 0,
|
|
102
|
+
v: state.fixedTime.isColorMode ? state.fixedTime.color?.v : 0,
|
|
103
|
+
temperature: state.fixedTime.isColorMode ? 0 : state.fixedTime.color?.temperature,
|
|
104
|
+
brightness: state.fixedTime.isColorMode ? 0 : state.fixedTime.color?.brightness
|
|
99
105
|
}
|
|
100
106
|
}
|
|
101
107
|
const res = await params.onPost(params.mode, editFixedTime)
|
|
@@ -190,9 +196,9 @@ const FixedTimeDetailPage = () => {
|
|
|
190
196
|
isSupportColor={!!params.isSupportColor}
|
|
191
197
|
isSupportBrightness={!!params.isSupportBrightness}
|
|
192
198
|
isSupportTemperature={!!params.isSupportTemperature}
|
|
193
|
-
isColorMode={state.isColorMode}
|
|
199
|
+
isColorMode={state.fixedTime.isColorMode ?? false}
|
|
194
200
|
reserveSV={true}
|
|
195
|
-
setIsColorMode={(v) => state.isColorMode = v}
|
|
201
|
+
setIsColorMode={(v) => state.fixedTime.isColorMode = v}
|
|
196
202
|
h={state.fixedTime.color.h}
|
|
197
203
|
s={state.fixedTime.color.s}
|
|
198
204
|
v={state.fixedTime.color.v}
|
|
@@ -102,7 +102,7 @@ export const useRandomTime: UseFixedTimeType = (dpKey: string, isPlug?: boolean,
|
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
})
|
|
105
|
-
},
|
|
105
|
+
}, 200)
|
|
106
106
|
|
|
107
107
|
return () => clearTimeout(randomTimer)
|
|
108
108
|
}, [randomTimeDp])
|
|
@@ -195,7 +195,7 @@ const randomTimeDp2Obj = (randomDp: string, isPlug?: boolean) => {
|
|
|
195
195
|
brightness,
|
|
196
196
|
temperature
|
|
197
197
|
},
|
|
198
|
-
isColorMode: !!(h
|
|
198
|
+
isColorMode: !!(h !== 0 || s !== 0 || v !== 0)
|
|
199
199
|
}
|
|
200
200
|
})
|
|
201
201
|
return {
|
|
@@ -35,21 +35,28 @@ const RandomTimeDetailPage = () => {
|
|
|
35
35
|
const is24Hour = useSystemTimeFormate()
|
|
36
36
|
const state = useReactive({
|
|
37
37
|
loading: false,
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
randomTime: cloneDeep(params.scheduleItem),
|
|
39
|
+
initRandomTime: cloneDeep(params.scheduleItem)
|
|
40
40
|
})
|
|
41
41
|
|
|
42
42
|
useEffect(() => {
|
|
43
43
|
if (!params.isPlug && state.randomTime.color) {
|
|
44
44
|
const { brightness, temperature, h, s, v } = state.randomTime.color
|
|
45
45
|
const isColor = brightness === 0 && temperature === 0 && (h !== 0 || s !== 0 || v !== 0)
|
|
46
|
-
state.isColorMode = isColor
|
|
46
|
+
state.randomTime.isColorMode = isColor
|
|
47
|
+
if (isColor) {
|
|
48
|
+
state.randomTime.color.brightness = 100;
|
|
49
|
+
} else {
|
|
50
|
+
state.randomTime.color.s = 100;
|
|
51
|
+
state.randomTime.color.v = 100;
|
|
52
|
+
}
|
|
53
|
+
state.initRandomTime = cloneDeep(state.randomTime)
|
|
47
54
|
}
|
|
48
55
|
}, [])
|
|
49
56
|
|
|
50
57
|
const checkItemChanged = useMemo(() =>{
|
|
51
|
-
return isEqual(state.randomTime,
|
|
52
|
-
}, [
|
|
58
|
+
return isEqual(state.randomTime, state.initRandomTime)
|
|
59
|
+
}, [JSON.stringify(state.initRandomTime), JSON.stringify(state.randomTime)])
|
|
53
60
|
|
|
54
61
|
const canSubmit = useMemo(() => {
|
|
55
62
|
return state.randomTime.name?.length > 0 && state.randomTime.name?.length < 33 && !checkItemChanged && state.randomTime.channel !== undefined
|
|
@@ -85,11 +92,11 @@ const RandomTimeDetailPage = () => {
|
|
|
85
92
|
}
|
|
86
93
|
if (!params.isPlug && state.randomTime.color) {
|
|
87
94
|
editRandomTime.color = {
|
|
88
|
-
h: state.isColorMode ? state.randomTime.color?.h : 0,
|
|
89
|
-
s: state.isColorMode ? state.randomTime.color?.s : 0,
|
|
90
|
-
v: state.isColorMode ? state.randomTime.color?.v : 0,
|
|
91
|
-
temperature: state.isColorMode ? 0 : state.randomTime.color?.temperature,
|
|
92
|
-
brightness: state.isColorMode ? 0 : state.randomTime.color?.brightness
|
|
95
|
+
h: state.randomTime.isColorMode ? state.randomTime.color?.h : 0,
|
|
96
|
+
s: state.randomTime.isColorMode ? state.randomTime.color?.s : 0,
|
|
97
|
+
v: state.randomTime.isColorMode ? state.randomTime.color?.v : 0,
|
|
98
|
+
temperature: state.randomTime.isColorMode ? 0 : state.randomTime.color?.temperature,
|
|
99
|
+
brightness: state.randomTime.isColorMode ? 0 : state.randomTime.color?.brightness
|
|
93
100
|
}
|
|
94
101
|
}
|
|
95
102
|
const res = await params.onPost(params.mode, editRandomTime)
|
|
@@ -184,9 +191,9 @@ const RandomTimeDetailPage = () => {
|
|
|
184
191
|
isSupportColor={!!params.isSupportColor}
|
|
185
192
|
isSupportBrightness={!!params.isSupportBrightness}
|
|
186
193
|
isSupportTemperature={!!params.isSupportTemperature}
|
|
187
|
-
isColorMode={state.isColorMode}
|
|
194
|
+
isColorMode={state.randomTime.isColorMode ?? false}
|
|
188
195
|
reserveSV={true}
|
|
189
|
-
setIsColorMode={(v) => state.isColorMode = v}
|
|
196
|
+
setIsColorMode={(v) => state.randomTime.isColorMode = v}
|
|
190
197
|
h={state.randomTime.color.h}
|
|
191
198
|
s={state.randomTime.color.s}
|
|
192
199
|
v={state.randomTime.color.v}
|
|
@@ -9,6 +9,7 @@ import { useParams } from '@ledvance/base/src/hooks/Hooks';
|
|
|
9
9
|
import Card from '@ledvance/base/src/components/Card';
|
|
10
10
|
import Spacer from '@ledvance/base/src/components/Spacer';
|
|
11
11
|
import { Utils } from 'tuya-panel-kit'
|
|
12
|
+
import {showDialog} from "@ledvance/base/src/utils/common";
|
|
12
13
|
|
|
13
14
|
const { convertX: cx } = Utils.RatioUtils
|
|
14
15
|
|
|
@@ -38,9 +39,26 @@ const RemoteControlPage = () => {
|
|
|
38
39
|
colorAlpha={1}
|
|
39
40
|
enable={remoteControl}
|
|
40
41
|
setEnable={async v => {
|
|
41
|
-
state.loading
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
if (state.loading) {
|
|
43
|
+
return
|
|
44
|
+
}
|
|
45
|
+
if (v) {
|
|
46
|
+
showDialog({
|
|
47
|
+
method: 'confirm',
|
|
48
|
+
title: I18n.getLang('Remotecontrol_Title'),
|
|
49
|
+
subTitle: I18n.getLang('Remotecontrol_description'),
|
|
50
|
+
onConfirm: async (_, { close }) => {
|
|
51
|
+
close()
|
|
52
|
+
state.loading = true
|
|
53
|
+
await setRemoteControl(v)
|
|
54
|
+
state.loading = false
|
|
55
|
+
}
|
|
56
|
+
})
|
|
57
|
+
} else {
|
|
58
|
+
state.loading = true
|
|
59
|
+
await setRemoteControl(v)
|
|
60
|
+
state.loading = false
|
|
61
|
+
}
|
|
44
62
|
}}
|
|
45
63
|
/>
|
|
46
64
|
</Card>
|
|
@@ -121,7 +121,7 @@ const wakeUpDp2Obj = (dp: string): WakeUpData | undefined => {
|
|
|
121
121
|
enable, weeks, delay, hour, minute, h, s, v, brightness, temperature, last, nodeHex, isSleep: false,
|
|
122
122
|
startTime,
|
|
123
123
|
endTime,
|
|
124
|
-
isColorMode: !!(h
|
|
124
|
+
isColorMode: !!(h !== 0 || s !== 0 || v !== 0)
|
|
125
125
|
}
|
|
126
126
|
})
|
|
127
127
|
return {
|
|
@@ -266,7 +266,7 @@ export const sleepDp2Obj = (dp: string): SleepData | undefined => {
|
|
|
266
266
|
enable, weeks, delay, hour, minute, h, s, v, brightness, temperature, nodeHex, isSleep: true,
|
|
267
267
|
startTime,
|
|
268
268
|
endTime,
|
|
269
|
-
isColorMode: !!(h
|
|
269
|
+
isColorMode: !!(h !== 0 || s !== 0 || v !== 0)
|
|
270
270
|
}
|
|
271
271
|
})
|
|
272
272
|
return {
|
|
@@ -19,8 +19,9 @@ export const defMixDeviceData = {
|
|
|
19
19
|
|
|
20
20
|
export const defStripDeviceData = {
|
|
21
21
|
...defDeviceData,
|
|
22
|
-
activeKey:
|
|
22
|
+
activeKey: 1,
|
|
23
23
|
colors: ColorList[0],
|
|
24
|
+
colorDiskActiveKey: 0
|
|
24
25
|
};
|
|
25
26
|
|
|
26
27
|
export const getTimeSchedule = async (deviceId: string): Promise<Timer[]> => {
|
|
@@ -42,7 +42,7 @@ import ManualSettings from './components/ManuaSettings';
|
|
|
42
42
|
import { defDeviceData, defMixDeviceData, defStripDeviceData } from './TimeScheduleActions';
|
|
43
43
|
import MoodItem from '../mood/MoodItem';
|
|
44
44
|
import { getRemoteMoodList } from '../mood/MoodActions';
|
|
45
|
-
import { MoodUIInfo } from '
|
|
45
|
+
import { MoodUIInfo } from '../mood/Interface';
|
|
46
46
|
import Summary from '@ledvance/base/src/components/Summary'
|
|
47
47
|
|
|
48
48
|
const { convertX: cx } = Utils.RatioUtils;
|
|
@@ -161,11 +161,8 @@ const TimeScheduleDetailPage = (props: { theme?: any }) => {
|
|
|
161
161
|
if (typeof time === 'number') {
|
|
162
162
|
return `${toFixedString(Math.trunc(time / 60), 2)}:${toFixedString(time % 60, 2)}`;
|
|
163
163
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
return Number(t[0]) * 60 + Number(t[1]);
|
|
167
|
-
}
|
|
168
|
-
return time;
|
|
164
|
+
const t = time.split(':');
|
|
165
|
+
return Number(t[0]) * 60 + Number(t[1]);
|
|
169
166
|
}, []);
|
|
170
167
|
|
|
171
168
|
const isModify = useMemo(() => {
|
|
@@ -460,6 +457,7 @@ const TimeScheduleDetailPage = (props: { theme?: any }) => {
|
|
|
460
457
|
isSupportBrightness={params.isSupportBrightness}
|
|
461
458
|
isSupportTemperature={params.isSupportTemperature}
|
|
462
459
|
isStripLight={params.isStripLight}
|
|
460
|
+
isCeilingLight={params.isCeilingLight}
|
|
463
461
|
manualData={state.manualData}
|
|
464
462
|
onManualChange={manual => {
|
|
465
463
|
state.manualData = {
|
|
@@ -622,15 +620,19 @@ const newTimeSchedule = () => {
|
|
|
622
620
|
|
|
623
621
|
const getDefaultManual = (props: TimeScheduleDetailPageParams): ComponentConfig => {
|
|
624
622
|
const deviceType =
|
|
625
|
-
props.isStripLight
|
|
623
|
+
props.isStripLight
|
|
626
624
|
? DeviceType.StripLight
|
|
627
625
|
: props.isMixLight
|
|
628
626
|
? DeviceType.MixLight
|
|
629
627
|
: props.isPowerStrip
|
|
630
628
|
? DeviceType.PowerStrip
|
|
631
|
-
:
|
|
629
|
+
: props.isFanLight
|
|
630
|
+
? DeviceType.FanLight
|
|
631
|
+
: props.isCeilingLight
|
|
632
|
+
? DeviceType.CeilingLight
|
|
633
|
+
: DeviceType.LightSource
|
|
632
634
|
const deviceData =
|
|
633
|
-
deviceType === DeviceType.StripLight
|
|
635
|
+
(deviceType === DeviceType.StripLight || deviceType === DeviceType.CeilingLight)
|
|
634
636
|
? defStripDeviceData
|
|
635
637
|
: deviceType === DeviceType.MixLight
|
|
636
638
|
? defMixDeviceData
|
|
@@ -194,7 +194,7 @@ const TimeSchedulePage = (props: { theme?: any }) => {
|
|
|
194
194
|
iconStyle={{ tintColor: props.theme.global.warning }}
|
|
195
195
|
/>
|
|
196
196
|
)}
|
|
197
|
-
{params.applyForList.length > 1 && !!state.originList.length && showTags}
|
|
197
|
+
{params.applyForList.length > 1 && !!state.originList.length && !(params.isCeilingLight || params.isMixLight) && showTags}
|
|
198
198
|
{state.timeScheduleList.length > 0 ? <FlatList
|
|
199
199
|
data={state.timeScheduleList}
|
|
200
200
|
renderItem={({ item }) => (
|
|
@@ -72,7 +72,7 @@ function ManualSettings(props: ManualSettingProps) {
|
|
|
72
72
|
<View key={item.dp}>
|
|
73
73
|
<Card style={{ marginHorizontal: cx(24) }}>
|
|
74
74
|
<LdvSwitch
|
|
75
|
-
title={item.key}
|
|
75
|
+
title={item.name || item.key}
|
|
76
76
|
color={props.theme.card.background}
|
|
77
77
|
colorAlpha={1}
|
|
78
78
|
enable={item.enable}
|
|
@@ -253,7 +253,7 @@ function ManualSettings(props: ManualSettingProps) {
|
|
|
253
253
|
const deviceData = state.deviceData as StripLightData
|
|
254
254
|
return (
|
|
255
255
|
<View>
|
|
256
|
-
<Card>
|
|
256
|
+
<Card style={{ marginHorizontal: cx(24) }}>
|
|
257
257
|
<LdvSwitch
|
|
258
258
|
title={I18n.getLang('light_sources_tile_tw_lighting_headline')}
|
|
259
259
|
color={props.theme.card.background}
|