@ledvance/group-ui-biz-bundle 1.0.155 → 1.0.156
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/fixedTimeForPlug/FixedTimeForPlugDetailPage.tsx +1 -1
- package/src/modules/fixedTimingForLight/FixedTimingForLightDetailPage.tsx +1 -1
- package/src/modules/flags/FlagInfo.tsx +12 -0
- package/src/modules/randomTimingForLight/RandomTimingForLightDetailPage.tsx +1 -1
- package/src/modules/timeSchedule/TimeSchedulePage.tsx +41 -1
- package/src/modules/timeSchedule/components/ScheduleCard.tsx +37 -3
package/package.json
CHANGED
|
@@ -38,7 +38,7 @@ const newFixedTimeItem = (): FixedTimeItem => {
|
|
|
38
38
|
channel: 0,
|
|
39
39
|
weeks: [0, 0, 0, 0, 0, 0, 0, 0],
|
|
40
40
|
startTime: startTime,
|
|
41
|
-
endTime: startTime +
|
|
41
|
+
endTime: startTime + 30, //Fix https://ledvance.atlassian.net/browse/SUH-12973
|
|
42
42
|
settingTime: new Date().getTime(),
|
|
43
43
|
onTime: 1,
|
|
44
44
|
offTime: 1
|
|
@@ -41,7 +41,7 @@ const newFixedTimingItem = (): FixedTimingItem => {
|
|
|
41
41
|
channel: 0,
|
|
42
42
|
weeks: [0, 0, 0, 0, 0, 0, 0],
|
|
43
43
|
startTime: startTime,
|
|
44
|
-
endTime: startTime +
|
|
44
|
+
endTime: startTime + 30, //Fix https://ledvance.atlassian.net/browse/SUH-12973
|
|
45
45
|
settingTime: new Date().getTime(),
|
|
46
46
|
openTime: 1,
|
|
47
47
|
closeTime: 1,
|
|
@@ -644,6 +644,18 @@ export const defFlagList: FlagUiInfo[] = [
|
|
|
644
644
|
...defFlagConfig,
|
|
645
645
|
colors: [{"h":207,"s":100,"v":81}, {"h":0,"s":0,"v":100}, {"h":109,"s":76,"v":69}],
|
|
646
646
|
},
|
|
647
|
+
{
|
|
648
|
+
id: 154,
|
|
649
|
+
name: I18n.getLang('country_IQ'),
|
|
650
|
+
...defFlagConfig,
|
|
651
|
+
colors: [{"h":353,"s":92,"v":81}, {"h":0,"s":0,"v":100}, {"h":0,"s":0,"v":0}, {"h":150,"s":100,"v":48}],
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
id: 153,
|
|
655
|
+
name: I18n.getLang('country_CD'),
|
|
656
|
+
...defFlagConfig,
|
|
657
|
+
colors: [{ h: 200, s: 100, v: 79 }, { h: 49, s: 100, v: 100 }, { h: 356, s: 79, v: 94 },],
|
|
658
|
+
},
|
|
647
659
|
]
|
|
648
660
|
|
|
649
661
|
export const def2Pids = ['k588eygmfkdzmpzm']
|
|
@@ -40,7 +40,7 @@ const newRandomTimingItem = (): RandomTimingItem => {
|
|
|
40
40
|
channel: 0,
|
|
41
41
|
weeks: [0, 0, 0, 0, 0, 0, 0],
|
|
42
42
|
startTime: startTime,
|
|
43
|
-
endTime: startTime +
|
|
43
|
+
endTime: startTime + 30, //Fix https://ledvance.atlassian.net/browse/SUH-12973
|
|
44
44
|
settingTime: new Date().getTime(),
|
|
45
45
|
color: {
|
|
46
46
|
hue: 0,
|
|
@@ -11,7 +11,7 @@ import InfoText from '@ledvance/base/src/components/InfoText';
|
|
|
11
11
|
import DeleteButton from '@ledvance/base/src/components/DeleteButton';
|
|
12
12
|
import {useReactive, useUpdateEffect} from 'ahooks';
|
|
13
13
|
import {addTimeSchedule, getTimeSchedule, modDelTimeSchedule, modifyTimeSchedule} from "./TimeScheduleActions";
|
|
14
|
-
import {DeviceStateType, Timer} from './Interface'
|
|
14
|
+
import { DeviceStateType, DeviceType, Timer } from './Interface'
|
|
15
15
|
import {useParams} from '@ledvance/base/src/hooks/Hooks';
|
|
16
16
|
import ScheduleCard from './components/ScheduleCard';
|
|
17
17
|
import {ui_biz_routerKey} from "../../navigation/Routers";
|
|
@@ -118,6 +118,45 @@ const TimeSchedulePage = (props: { theme?: ThemeType }) => {
|
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
+
const calculateTagStatus: (item: Timer) => ApplyForItem[] = useCallback((item: Timer) => {
|
|
122
|
+
return params.applyForList.map(tag => {
|
|
123
|
+
const deviceData = params.manualDataDp2Obj(item.dps).deviceData
|
|
124
|
+
if (params.isMixLight && deviceData.type === DeviceType.MixLight) {
|
|
125
|
+
return {
|
|
126
|
+
...tag,
|
|
127
|
+
enable:
|
|
128
|
+
tag.type === 'mainLight'
|
|
129
|
+
? deviceData.deviceData.whiteLightSwitch
|
|
130
|
+
: deviceData.deviceData.colorLightSwitch,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
if (item.dps.hasOwnProperty(tag.dp)) {
|
|
134
|
+
return {
|
|
135
|
+
...tag,
|
|
136
|
+
enable: item.dps[tag.dp],
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
return tag;
|
|
140
|
+
}).filter(tag => params.applyForDisabled || item.dps.hasOwnProperty(tag.dp))
|
|
141
|
+
.map(tag => {
|
|
142
|
+
const {isManual} = params.manualDataDp2Obj(item.dps)
|
|
143
|
+
let tagName: string;
|
|
144
|
+
if (isManual) {
|
|
145
|
+
if (tag.enable) {
|
|
146
|
+
tagName = `${tag.key} : ${I18n.getLang(params.isShutter ? 'curtain_summary_action_txt_1' : 'routine_push_msg_on')}`
|
|
147
|
+
} else {
|
|
148
|
+
tagName = `${tag.key} : ${I18n.getLang(params.isShutter ? 'curtain_summary_action_txt_2' : 'watchapp_entitystate_off')}`
|
|
149
|
+
}
|
|
150
|
+
} else {
|
|
151
|
+
tagName = `${tag.key} : ${I18n.getLang('mood_overview_headline_text')}`
|
|
152
|
+
}
|
|
153
|
+
return {
|
|
154
|
+
...tag,
|
|
155
|
+
key: tagName,
|
|
156
|
+
};
|
|
157
|
+
});
|
|
158
|
+
}, [])
|
|
159
|
+
|
|
121
160
|
const styles = StyleSheet.create({
|
|
122
161
|
overviewDescription: {
|
|
123
162
|
color: props.theme?.global.fontColor,
|
|
@@ -173,6 +212,7 @@ const TimeSchedulePage = (props: { theme?: ThemeType }) => {
|
|
|
173
212
|
renderItem={({ item }) => (
|
|
174
213
|
<ScheduleCard
|
|
175
214
|
item={item}
|
|
215
|
+
calculateTagStatus={() => calculateTagStatus(item)}
|
|
176
216
|
onEnableChange={async enable => {
|
|
177
217
|
state.loading = true;
|
|
178
218
|
await modDeleteTimeSchedule('del', {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ApplyForItem } from '@ledvance/base/src/utils/interface'
|
|
2
|
+
import React, { useMemo } from 'react'
|
|
2
3
|
import { ViewStyle, View, Text, StyleSheet } from "react-native";
|
|
3
4
|
import Card from "@ledvance/base/src/components/Card";
|
|
4
5
|
import { SwitchButton, Utils } from 'tuya-panel-kit';
|
|
@@ -14,14 +15,16 @@ interface ScheduleCardProps {
|
|
|
14
15
|
theme?: ThemeType
|
|
15
16
|
item: Timer
|
|
16
17
|
style?: ViewStyle
|
|
18
|
+
calculateTagStatus: () => ApplyForItem[]
|
|
17
19
|
onEnableChange: (enable: boolean) => void
|
|
18
20
|
onPress: () => void
|
|
19
21
|
onLongPress: () => void
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
const ScheduleCard = (props: ScheduleCardProps) => {
|
|
23
|
-
const { item, style, onEnableChange, onPress, onLongPress } = props;
|
|
25
|
+
const { item, style, calculateTagStatus, onEnableChange, onPress, onLongPress } = props;
|
|
24
26
|
const is24HourClock = useSystemTimeFormate()
|
|
27
|
+
const tags = useMemo(() => calculateTagStatus(), [item.dps])
|
|
25
28
|
|
|
26
29
|
const styles = StyleSheet.create({
|
|
27
30
|
card: {
|
|
@@ -62,14 +65,35 @@ const ScheduleCard = (props: ScheduleCardProps) => {
|
|
|
62
65
|
marginRight: cx(16),
|
|
63
66
|
marginTop: cx(16),
|
|
64
67
|
},
|
|
68
|
+
typeContainer: {
|
|
69
|
+
flexDirection: 'row',
|
|
70
|
+
flexWrap: 'wrap',
|
|
71
|
+
marginVertical: cx(8),
|
|
72
|
+
marginHorizontal: cx(16),
|
|
73
|
+
},
|
|
74
|
+
tag: {
|
|
75
|
+
borderRadius: cx(16),
|
|
76
|
+
height: cx(16),
|
|
77
|
+
backgroundColor: '#E6E7E8',
|
|
78
|
+
marginRight: cx(10),
|
|
79
|
+
marginBottom: cx(6),
|
|
80
|
+
paddingHorizontal: cx(10)
|
|
81
|
+
},
|
|
82
|
+
tagTitle: {
|
|
83
|
+
fontSize: cx(10),
|
|
84
|
+
textAlign: 'center',
|
|
85
|
+
// fontFamily: 'PingFangSC-Medium',
|
|
86
|
+
color: '#000'
|
|
87
|
+
},
|
|
65
88
|
})
|
|
66
89
|
|
|
67
90
|
return (
|
|
68
91
|
<Card
|
|
69
92
|
style={styles.card}
|
|
70
|
-
containerStyle={[
|
|
93
|
+
containerStyle={[style]}
|
|
71
94
|
onPress={onPress}
|
|
72
95
|
onLongPress={onLongPress}>
|
|
96
|
+
<View style={styles.container}>
|
|
73
97
|
<View style={styles.infoContainer}>
|
|
74
98
|
<Text style={styles.time}>{is24HourClock ? item.time : convertTo12HourFormat(item.time)}</Text>
|
|
75
99
|
<Text style={styles.loop}>
|
|
@@ -86,6 +110,16 @@ const ScheduleCard = (props: ScheduleCardProps) => {
|
|
|
86
110
|
}}
|
|
87
111
|
/>
|
|
88
112
|
</View>
|
|
113
|
+
</View>
|
|
114
|
+
<View style={styles.typeContainer}>
|
|
115
|
+
{tags.map(tag => (
|
|
116
|
+
<View style={styles.tag} key={tag.dp}>
|
|
117
|
+
<Text style={styles.tagTitle}>
|
|
118
|
+
{tag.key}
|
|
119
|
+
</Text>
|
|
120
|
+
</View>
|
|
121
|
+
))}
|
|
122
|
+
</View>
|
|
89
123
|
</Card>
|
|
90
124
|
)
|
|
91
125
|
|