@ledvance/group-ui-biz-bundle 1.0.85 → 1.0.87
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/childLock/ChildLockPage.tsx +4 -2
- package/src/modules/energyConsumption/EnergyConsumptionActions.ts +1 -5
- package/src/modules/energyConsumption/EnergyConsumptionChart.tsx +20 -5
- package/src/modules/flags/FlagActions.ts +2 -1
- package/src/modules/flags/FlagPage.tsx +1 -0
- package/src/modules/mood_new/Interface.ts +1 -0
- package/src/modules/mood_new/MoodActions.ts +2 -2
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@ interface ChildLockConfig {
|
|
|
17
17
|
childLock: boolean
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
export function useChildLock(): [boolean, (v: boolean) => Promise<Result<any>>] {
|
|
20
|
+
export function useChildLock(): [boolean, (v: boolean, extraDps?: any, extraConfig?: any) => Promise<Result<any>>] {
|
|
21
21
|
return useFeatureHook<ChildLockConfig, boolean>('childLock', false)
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -88,7 +88,9 @@ const ChildLockPage = (props: { theme?: ThemeType }) => {
|
|
|
88
88
|
<Spacer style={{ flex: 1 }} height={0} width={0} />
|
|
89
89
|
<SwitchButton value={childLock} onValueChange={async v => {
|
|
90
90
|
state.loading = true
|
|
91
|
-
await setChildLock(v
|
|
91
|
+
await setChildLock(v, undefined, {
|
|
92
|
+
'controlLock': v
|
|
93
|
+
})
|
|
92
94
|
state.loading = false
|
|
93
95
|
} } />
|
|
94
96
|
</View>
|
|
@@ -78,10 +78,6 @@ const getDpResultByYearMonth = async (deviceIdGroup: string[], addEleDpCode: str
|
|
|
78
78
|
const date = dayjs(dateStr)
|
|
79
79
|
const startDay = date.startOf('month').format('YYYYMMDD')
|
|
80
80
|
const endDay = date.endOf('month').format('YYYYMMDD')
|
|
81
|
-
if (overDays(startDay, 365)) {
|
|
82
|
-
console.log("getDpResultByYearMonth overDays true")
|
|
83
|
-
return []
|
|
84
|
-
}
|
|
85
81
|
const promiseGroup = deviceIdGroup.map(devId => getDataWithSpecified(devId, addEleDpCode, startDay, endDay, 'sum').catch(error => ({error})))
|
|
86
82
|
const res = await Promise.all(promiseGroup);
|
|
87
83
|
// @ts-ignore
|
|
@@ -140,7 +136,7 @@ const getDpResultByDate = async (deviceIdGroup: string[], addEleDpCode: string,
|
|
|
140
136
|
mergedData[day] += Number(isNumber(dayNum) ? dayNum : 0)
|
|
141
137
|
})
|
|
142
138
|
}
|
|
143
|
-
})
|
|
139
|
+
});
|
|
144
140
|
|
|
145
141
|
|
|
146
142
|
const list: Array<OverviewItem> = []
|
|
@@ -82,6 +82,7 @@ const EnergyConsumptionChart = (props: { theme?: ThemeType }) => {
|
|
|
82
82
|
useUpdateEffect(() => {
|
|
83
83
|
state.over365Days = overDays(state.date, 365);
|
|
84
84
|
state.over7Days = overDays(state.date, 7);
|
|
85
|
+
updateHeadlineText(dayjs(state.date));
|
|
85
86
|
state.loading = true;
|
|
86
87
|
getElectricity(deviceIdGroup, addEleDpCode, state.date, state.dateType).then((res) => {
|
|
87
88
|
state.chartData = res;
|
|
@@ -94,23 +95,37 @@ const EnergyConsumptionChart = (props: { theme?: ThemeType }) => {
|
|
|
94
95
|
const year = date.year().toString();
|
|
95
96
|
const month = (date.month() + 1).toString().padStart(2, '0');
|
|
96
97
|
const day = date.date().toString().padStart(2, '0');
|
|
97
|
-
const dayOfWeek = date.day() % 7;
|
|
98
98
|
switch (state.dateType) {
|
|
99
99
|
case DateType.Year:
|
|
100
100
|
state.date = year;
|
|
101
|
-
state.headlineText = year;
|
|
102
101
|
break
|
|
103
102
|
case DateType.Month:
|
|
104
103
|
state.date = `${year}${month}`
|
|
105
|
-
state.headlineText = `${monthFormat(month)} ${year}`;
|
|
106
104
|
break
|
|
107
105
|
case DateType.Day:
|
|
108
106
|
state.date = `${year}${month}${day}`
|
|
109
|
-
state.headlineText = `${day}/${month}/${year}\n${loopsText[dayOfWeek]}`;
|
|
110
107
|
break
|
|
111
108
|
}
|
|
112
109
|
}, [state.dateType]);
|
|
113
110
|
|
|
111
|
+
const updateHeadlineText = useCallback((date: dayjs.Dayjs) => {
|
|
112
|
+
const year = date.year().toString();
|
|
113
|
+
const month = (date.month() + 1).toString().padStart(2, '0');
|
|
114
|
+
const day = date.date().toString().padStart(2, '0');
|
|
115
|
+
const dayOfWeek = date.day() % 7;
|
|
116
|
+
switch (state.dateType) {
|
|
117
|
+
case DateType.Year:
|
|
118
|
+
state.headlineText = year;
|
|
119
|
+
break
|
|
120
|
+
case DateType.Month:
|
|
121
|
+
state.headlineText = `${monthFormat(month)} ${year}`;
|
|
122
|
+
break
|
|
123
|
+
case DateType.Day:
|
|
124
|
+
state.headlineText = `${day}/${month}/${year}\n${loopsText[dayOfWeek]}`;
|
|
125
|
+
break
|
|
126
|
+
}
|
|
127
|
+
}, [state.dateType, state.headlineText]);
|
|
128
|
+
|
|
114
129
|
const getEmptyDataTip = useCallback(() => {
|
|
115
130
|
if (state.over365Days) {
|
|
116
131
|
return I18n.getLang('energyconsumption_Daylimit')
|
|
@@ -168,7 +183,7 @@ const EnergyConsumptionChart = (props: { theme?: ThemeType }) => {
|
|
|
168
183
|
</View>
|
|
169
184
|
) : (
|
|
170
185
|
state.chartData.length > 0 && !state.loading &&
|
|
171
|
-
<NewBarChart height={400} data={state.chartData} price={state.price}
|
|
186
|
+
<NewBarChart height={cx(400)} data={state.chartData} price={state.price}
|
|
172
187
|
unit={unit}/>
|
|
173
188
|
)
|
|
174
189
|
}
|
|
@@ -75,7 +75,8 @@ export const useFlag: UseFlagType = (params) => {
|
|
|
75
75
|
if (params.isStringLight){
|
|
76
76
|
dps[getGlobalParamsDp('rgbic_linerlight_scene')] = moodDp
|
|
77
77
|
}else{
|
|
78
|
-
|
|
78
|
+
const newMoodDp = params.isSolarLight ? ('01'+moodDp.substring(2)) : moodDp
|
|
79
|
+
dps[getGlobalParamsDp('scene_data')] = newMoodDp
|
|
79
80
|
}
|
|
80
81
|
dps[getGlobalParamsDp('work_mode')] = WorkMode.Scene
|
|
81
82
|
}else{
|
|
@@ -70,8 +70,8 @@ export function useMoodScene(params: MoodPageParams): [SceneDataType, (value: Sc
|
|
|
70
70
|
if (mainLamp?.nodes?.length) {
|
|
71
71
|
const mainDp = getMoodDp(params.isCeilingLight ? ({...moodInfo.scene, id: mainLamp.id!}) : moodInfo.scene, params)
|
|
72
72
|
if (mainDp && params.mainDp) {
|
|
73
|
-
dps[params.mainDp] = mainDp
|
|
74
|
-
dps[params.mainSwitch] = true
|
|
73
|
+
dps[params.mainDp] = params.isSolarLight ? ('01' + mainDp.substring(2)) : mainDp;
|
|
74
|
+
dps[params.mainSwitch] = true
|
|
75
75
|
dps[params.mainWorkMode] = WorkMode.Scene
|
|
76
76
|
if (params.isUVCFan){
|
|
77
77
|
dps[getGlobalParamsDp('fan_switch')] = mainLamp.fanEnable
|