@ledvance/group-ui-biz-bundle 1.0.93 → 1.0.95
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
|
@@ -2,7 +2,7 @@ import React, {useCallback, useEffect, useMemo} from 'react';
|
|
|
2
2
|
import Page from '@ledvance/base/src/components/Page';
|
|
3
3
|
import {Utils} from 'tuya-panel-kit';
|
|
4
4
|
import {useDeviceInfo} from '@ledvance/base/src/models/modules/NativePropsSlice';
|
|
5
|
-
import {useReactive} from 'ahooks';
|
|
5
|
+
import {useReactive, useUpdateEffect} from 'ahooks';
|
|
6
6
|
import I18n from '@ledvance/base/src/i18n';
|
|
7
7
|
import res from '@ledvance/base/src/res';
|
|
8
8
|
import {FlatList, Image, Platform, StyleSheet, TouchableOpacity, View} from 'react-native';
|
|
@@ -111,6 +111,10 @@ const DiyScenePage = (props: { theme?: ThemeType }) => {
|
|
|
111
111
|
[workMode, switchLed, sceneStatusId]
|
|
112
112
|
);
|
|
113
113
|
|
|
114
|
+
useUpdateEffect(() => {
|
|
115
|
+
state.originScenes = cloneDeep(scenes) as DiySceneInfo[];
|
|
116
|
+
}, [scenes]);
|
|
117
|
+
|
|
114
118
|
const nameRepeat = useCallback((scene: DiySceneInfo) => {
|
|
115
119
|
return !!state.originScenes.filter(m => m.id !== scene.id).find(m => m.name === scene.name)
|
|
116
120
|
}, [state.originScenes])
|
|
@@ -231,7 +235,7 @@ const DiyScenePage = (props: { theme?: ThemeType }) => {
|
|
|
231
235
|
subTitle: I18n.getLang('reset_mooddescription'),
|
|
232
236
|
onConfirm: async (_, { close }) => {
|
|
233
237
|
close()
|
|
234
|
-
resetMixScenes()
|
|
238
|
+
resetMixScenes().then();
|
|
235
239
|
}
|
|
236
240
|
})
|
|
237
241
|
}}
|
|
@@ -97,6 +97,7 @@ export function useMoodScene(params: MoodPageParams): [SceneDataType, (value: Sc
|
|
|
97
97
|
if(params.isCeilingLight){
|
|
98
98
|
dps[params.mainWorkMode] = WorkMode.White
|
|
99
99
|
dps[params.secondaryWorkMode!] = WorkMode.Colour
|
|
100
|
+
dps[params.secondarySwitch!] = false
|
|
100
101
|
}else{
|
|
101
102
|
if (params.isFanLight || params.isUVCFan){
|
|
102
103
|
dps[params.mainWorkMode] = WorkMode.Control
|
|
@@ -282,12 +282,22 @@ function ManualSettings(props: ManualSettingProps) {
|
|
|
282
282
|
|
|
283
283
|
const stripLightCard = useMemo(() => {
|
|
284
284
|
const deviceData = state.deviceData as StripLightData
|
|
285
|
+
const getBlockColor = () => {
|
|
286
|
+
if (deviceData.activeKey === 1) {
|
|
287
|
+
const s = Math.round(mapFloatToRange(state.deviceData.s / 100, 30, 100))
|
|
288
|
+
return hsv2Hex(state.deviceData.h, s, 100)
|
|
289
|
+
}
|
|
290
|
+
if (deviceData.activeKey === 0) {
|
|
291
|
+
return cctToColor(state.deviceData.temperature)
|
|
292
|
+
}
|
|
293
|
+
return props.theme?.card.background
|
|
294
|
+
}
|
|
285
295
|
return (
|
|
286
296
|
<View>
|
|
287
297
|
<Card style={{ marginHorizontal: cx(24) }}>
|
|
288
298
|
<LdvSwitch
|
|
289
299
|
title={I18n.getLang('light_sources_tile_tw_lighting_headline')}
|
|
290
|
-
color={
|
|
300
|
+
color={getBlockColor()}
|
|
291
301
|
colorAlpha={1}
|
|
292
302
|
enable={state.applyForList[0]?.enable}
|
|
293
303
|
setEnable={(enable: boolean) => {
|