@ledvance/group-ui-biz-bundle 1.0.124 → 1.0.127
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
|
@@ -3,9 +3,14 @@ import {ScrollView, StyleSheet, Text, View} from 'react-native'
|
|
|
3
3
|
import {useReactive, useUpdateEffect} from 'ahooks'
|
|
4
4
|
import {Utils} from 'tuya-panel-kit'
|
|
5
5
|
import Page from '@ledvance/base/src/components/Page'
|
|
6
|
-
import {
|
|
6
|
+
import {useUAGroupInfo} from '@ledvance/base/src/models/modules/NativePropsSlice'
|
|
7
7
|
import I18n from '@ledvance/base/src/i18n'
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
LightBehaviorPageParams,
|
|
10
|
+
PowerOffMemoryModel,
|
|
11
|
+
useDoNotDisturbControl,
|
|
12
|
+
usePowerOffMemory
|
|
13
|
+
} from './PowerOnBehaviorActions'
|
|
9
14
|
import Spacer from '@ledvance/base/src/components/Spacer'
|
|
10
15
|
import Card from '@ledvance/base/src/components/Card'
|
|
11
16
|
import LampAdjustView from '@ledvance/base/src/components/LampAdjustView'
|
|
@@ -23,18 +28,32 @@ export enum PowerMemoryMode {
|
|
|
23
28
|
Last = 1,
|
|
24
29
|
Custom = 2
|
|
25
30
|
}
|
|
31
|
+
|
|
32
|
+
const initCustomValue = (powerMemory: PowerOffMemoryModel) => {
|
|
33
|
+
const newPowerMemory = cloneDeep(powerMemory)
|
|
34
|
+
if (newPowerMemory.isColor) {
|
|
35
|
+
newPowerMemory.temperature = 100
|
|
36
|
+
newPowerMemory.bright = 100
|
|
37
|
+
} else {
|
|
38
|
+
newPowerMemory.hue = 0
|
|
39
|
+
newPowerMemory.sat = 100
|
|
40
|
+
newPowerMemory.hue = 100
|
|
41
|
+
}
|
|
42
|
+
return newPowerMemory
|
|
43
|
+
}
|
|
44
|
+
|
|
26
45
|
const LightBehaviorPage = (props: { theme?: ThemeType }) => {
|
|
27
46
|
const params = useParams<LightBehaviorPageParams>()
|
|
28
|
-
const
|
|
47
|
+
const uaGroupInfo = useUAGroupInfo()
|
|
29
48
|
const [powerMemory, setPowerMemory] = usePowerOffMemory()
|
|
30
49
|
const [doNotDisturb, setDoNotDisturb] = useDoNotDisturbControl()
|
|
31
50
|
const state = useReactive({
|
|
32
51
|
loading: false,
|
|
33
|
-
powerMemory:
|
|
52
|
+
powerMemory: initCustomValue(powerMemory),
|
|
34
53
|
})
|
|
35
54
|
|
|
36
55
|
useUpdateEffect(() => {
|
|
37
|
-
state.powerMemory = powerMemory
|
|
56
|
+
state.powerMemory = cloneDeep(powerMemory)
|
|
38
57
|
}, [JSON.stringify(powerMemory)])
|
|
39
58
|
|
|
40
59
|
const styles = StyleSheet.create({
|
|
@@ -56,7 +75,7 @@ const LightBehaviorPage = (props: { theme?: ThemeType }) => {
|
|
|
56
75
|
|
|
57
76
|
return (
|
|
58
77
|
<Page
|
|
59
|
-
backText={
|
|
78
|
+
backText={uaGroupInfo.name}
|
|
60
79
|
headlineText={I18n.getLang('light_sources_specific_settings_power_off')}
|
|
61
80
|
loading={state.loading}>
|
|
62
81
|
<ScrollView style={styles.root} nestedScrollEnabled={true}>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import {ScrollView, StyleSheet} from 'react-native'
|
|
3
3
|
import Page from '@ledvance/base/src/components/Page'
|
|
4
|
-
import {
|
|
4
|
+
import {useUAGroupInfo} from '@ledvance/base/src/models/modules/NativePropsSlice'
|
|
5
5
|
import I18n from '@ledvance/base/src/i18n'
|
|
6
6
|
import {PowerBehaviorPageParams, usePowerBehavior} from './PowerOnBehaviorActions'
|
|
7
7
|
import {Utils} from 'tuya-panel-kit'
|
|
@@ -21,7 +21,7 @@ const RELAY_STATUS_MEMORY = 'memory'
|
|
|
21
21
|
|
|
22
22
|
const PlugBehaviorPage = () => {
|
|
23
23
|
const params = useParams<PowerBehaviorPageParams>()
|
|
24
|
-
const
|
|
24
|
+
const uaGroupInfo = useUAGroupInfo()
|
|
25
25
|
const [powerMemories, setPowerMemories] = usePowerBehavior(params.powerBehaviorKeys)
|
|
26
26
|
|
|
27
27
|
const state = useReactive({
|
|
@@ -42,7 +42,7 @@ const PlugBehaviorPage = () => {
|
|
|
42
42
|
|
|
43
43
|
return (
|
|
44
44
|
<Page
|
|
45
|
-
backText={
|
|
45
|
+
backText={uaGroupInfo.name}
|
|
46
46
|
headlineText={I18n.getLang('light_sources_specific_settings_power_off')}
|
|
47
47
|
loading={state.loading}>
|
|
48
48
|
<ScrollView style={styles.root} nestedScrollEnabled={true}>
|
|
@@ -2,6 +2,7 @@ import {useFeatureHook} from "@ledvance/base/src/models/modules/NativePropsSlice
|
|
|
2
2
|
import {Result} from "@ledvance/base/src/models/modules/Result"
|
|
3
3
|
import {Utils} from 'tuya-panel-kit';
|
|
4
4
|
import {spliceByStep} from "@ledvance/base/src/utils/common";
|
|
5
|
+
import {cloneDeep} from "lodash";
|
|
5
6
|
|
|
6
7
|
const { hexStringToNumber } = Utils.StringUtils;
|
|
7
8
|
|
|
@@ -109,7 +110,8 @@ export function dp2Obj(dp: string): PowerOffMemoryModel {
|
|
|
109
110
|
};
|
|
110
111
|
}
|
|
111
112
|
|
|
112
|
-
export function obj2Dp(
|
|
113
|
+
export function obj2Dp(powerMemory: PowerOffMemoryModel): string {
|
|
114
|
+
const obj = cloneDeep(powerMemory)
|
|
113
115
|
const version = '00';
|
|
114
116
|
if (obj.isColor) {
|
|
115
117
|
obj.bright = 0
|
|
@@ -56,7 +56,9 @@ const RemoteSwitchPage = (props: { theme?: ThemeType }) => {
|
|
|
56
56
|
|
|
57
57
|
return (<Page
|
|
58
58
|
backText={uaGroupInfo.name}
|
|
59
|
-
loading={state.loading}
|
|
59
|
+
loading={state.loading}
|
|
60
|
+
headlineText={I18n.getLang('light_sources_specific_settings_remote_control')}
|
|
61
|
+
>
|
|
60
62
|
<View style={[styles.titleBGView, styles.shadow]}>
|
|
61
63
|
<Text style={styles.title}>{I18n.getLang('light_sources_specific_settings_remote_control')}</Text>
|
|
62
64
|
<View style={[styles.colorBlock, { backgroundColor: 'red', opacity: 0 }]} />
|