@ledvance/group-ui-biz-bundle 1.0.46 → 1.0.48
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/biorhythm/BiorhythmActions.ts +5 -13
- package/src/modules/biorhythm/BiorhythmBean.ts +6 -6
- package/src/modules/biorhythm/BiorhythmPage.tsx +373 -420
- package/src/modules/biorhythm/Router.ts +34 -0
- package/src/modules/fixedTimeForPlug/Router.ts +25 -0
- package/src/modules/fixedTimingForLight/Router.ts +25 -0
- package/src/modules/flags/Router.ts +25 -0
- package/src/modules/mood/AddMoodPage.tsx +2 -2
- package/src/modules/mood_new/AddMoodPage.tsx +197 -0
- package/src/modules/mood_new/DynamicMoodEditorPage.tsx +654 -0
- package/src/modules/mood_new/Interface.ts +219 -0
- package/src/modules/mood_new/MixDynamicMoodEditor.tsx +788 -0
- package/src/modules/mood_new/MoodActions.ts +227 -0
- package/src/modules/mood_new/MoodInfo.ts +2151 -0
- package/src/modules/mood_new/MoodItem.tsx +148 -0
- package/src/modules/mood_new/MoodPage.tsx +374 -0
- package/src/modules/mood_new/MoodParse.ts +442 -0
- package/src/modules/mood_new/RecommendMoodItem.tsx +69 -0
- package/src/modules/mood_new/Router.ts +43 -0
- package/src/modules/mood_new/StaticMoodEditorPage.tsx +293 -0
- package/src/modules/music/Router.ts +16 -0
- package/src/modules/randomTimeForPlug/Router.ts +25 -0
- package/src/modules/randomTimingForLight/Router.ts +25 -0
- package/src/modules/remoteSwitch/Router.ts +16 -0
- package/src/modules/select/Router.ts +16 -0
- package/src/modules/switchGradient/Router.ts +16 -0
- package/src/modules/timeSchedule/Interface.ts +150 -0
- package/src/modules/timeSchedule/Router.ts +25 -0
- package/src/modules/timeSchedule/TimeScheduleActions.ts +140 -0
- package/src/modules/timeSchedule/TimeScheduleDetailPage.tsx +625 -0
- package/src/modules/timeSchedule/TimeSchedulePage.tsx +220 -0
- package/src/modules/timeSchedule/components/ManuaSettings.tsx +376 -0
- package/src/modules/timeSchedule/components/ScheduleCard.tsx +109 -0
- package/src/modules/timeSchedule/components/Summary.tsx +124 -0
- package/src/modules/timer/Router.ts +16 -0
- package/src/navigation/Routers.ts +1 -0
package/package.json
CHANGED
|
@@ -7,11 +7,10 @@ import {
|
|
|
7
7
|
Plan,
|
|
8
8
|
} from './BiorhythmBean'
|
|
9
9
|
import { useFeatureHook} from '@ledvance/base/src/models/modules/NativePropsSlice'
|
|
10
|
-
import { NativeApi } from '@ledvance/base/src/api/native'
|
|
11
10
|
import {hex2Int, spliceByStep} from '@ledvance/base/src/utils/common'
|
|
12
11
|
import I18n from '@ledvance/base/src/i18n'
|
|
13
12
|
import BiologicalRes from './res/BiologicalRes'
|
|
14
|
-
import
|
|
13
|
+
import { to16 } from '@tuya/tuya-panel-lamp-sdk/lib/utils'
|
|
15
14
|
|
|
16
15
|
interface BiorhythmConfig {
|
|
17
16
|
rhythm_mode: BiorhythmBean
|
|
@@ -23,12 +22,6 @@ export const useBiorhythm = () => {
|
|
|
23
22
|
})
|
|
24
23
|
}
|
|
25
24
|
|
|
26
|
-
export const userOperation = async (deviceId: string, value: boolean) => {
|
|
27
|
-
const currentTime = dayjs().format('YYYY-MM-DD')
|
|
28
|
-
const json = JSON.stringify({status: value, suspendTime: value && currentTime || ''})
|
|
29
|
-
return await NativeApi.putJson(deviceId, 'suspendTime', json)
|
|
30
|
-
}
|
|
31
|
-
|
|
32
25
|
export function dp2Obj(dp: string): BiorhythmBean {
|
|
33
26
|
if (!dp || dp === '0000000000') {
|
|
34
27
|
return dp2Obj('0000007f0501060000000000000001061e00000000141901090000000000646401140000000000503201171e000000000000')
|
|
@@ -75,7 +68,7 @@ export function dp2Obj(dp: string): BiorhythmBean {
|
|
|
75
68
|
// 分钟
|
|
76
69
|
const minute = hex2Int(hex.slice(0, 2)).toString().padStart(2, '0')
|
|
77
70
|
hex = hex.slice(2)
|
|
78
|
-
const
|
|
71
|
+
const time = hour * 60 + minute
|
|
79
72
|
// 色调 (色相)
|
|
80
73
|
hex2Int(hex.slice(0, 4))
|
|
81
74
|
hex = hex.slice(4)
|
|
@@ -94,7 +87,7 @@ export function dp2Obj(dp: string): BiorhythmBean {
|
|
|
94
87
|
id: index,
|
|
95
88
|
enable: enable,
|
|
96
89
|
icon: getNodeIconByIndex(index),
|
|
97
|
-
|
|
90
|
+
time,
|
|
98
91
|
name: getNodeNameByIndex(index),
|
|
99
92
|
colorTemperature: colorTemperature,
|
|
100
93
|
brightness: brightness,
|
|
@@ -203,9 +196,8 @@ function obj2Dp(obj: BiorhythmBean): string {
|
|
|
203
196
|
const planListHex = obj.planList
|
|
204
197
|
.map(plan => {
|
|
205
198
|
const enableHex = plan.enable ? '01' : '00'
|
|
206
|
-
const
|
|
207
|
-
const
|
|
208
|
-
const minuteHex = parseInt(startTime[1]).toString(16).padStart(2, '0')
|
|
199
|
+
const hourHex = to16(Math.trunc(plan.time / 60))
|
|
200
|
+
const minuteHex = to16(plan.time % 60)
|
|
209
201
|
const hsvHex = '00000000'
|
|
210
202
|
const brightnessHex = plan.brightness.toString(16).padStart(2, '0')
|
|
211
203
|
const colorTemperatureHex = plan.colorTemperature.toString(16).padStart(2, '0')
|
|
@@ -29,7 +29,7 @@ export interface Plan {
|
|
|
29
29
|
id: number;
|
|
30
30
|
enable: boolean;
|
|
31
31
|
icon: string;
|
|
32
|
-
|
|
32
|
+
time: number;
|
|
33
33
|
name: string;
|
|
34
34
|
colorTemperature: number;
|
|
35
35
|
brightness: number;
|
|
@@ -71,7 +71,7 @@ export function getDefBiorhythmUIState(): BiorhythmBean {
|
|
|
71
71
|
{
|
|
72
72
|
id: 0,
|
|
73
73
|
icon: icon1,
|
|
74
|
-
|
|
74
|
+
time: 360,
|
|
75
75
|
name: I18n.getLang('bio_ryhthm_default_field_text'),
|
|
76
76
|
colorTemperature: 0,
|
|
77
77
|
brightness: 0,
|
|
@@ -91,7 +91,7 @@ export function getDefBiorhythmUIState(): BiorhythmBean {
|
|
|
91
91
|
{
|
|
92
92
|
id: 1,
|
|
93
93
|
icon: icon12,
|
|
94
|
-
|
|
94
|
+
time: 420,
|
|
95
95
|
name: I18n.getLang('bio_ryhthm_default_field_text2'),
|
|
96
96
|
colorTemperature: 25,
|
|
97
97
|
brightness: 20,
|
|
@@ -111,7 +111,7 @@ export function getDefBiorhythmUIState(): BiorhythmBean {
|
|
|
111
111
|
{
|
|
112
112
|
id: 2,
|
|
113
113
|
icon: icon2,
|
|
114
|
-
|
|
114
|
+
time: 540,
|
|
115
115
|
name: I18n.getLang('bio_ryhthm_default_field_text3'),
|
|
116
116
|
colorTemperature: 100,
|
|
117
117
|
brightness: 100,
|
|
@@ -131,7 +131,7 @@ export function getDefBiorhythmUIState(): BiorhythmBean {
|
|
|
131
131
|
{
|
|
132
132
|
id: 3,
|
|
133
133
|
icon: icon3,
|
|
134
|
-
|
|
134
|
+
time: 1200,
|
|
135
135
|
name: I18n.getLang('bio_ryhthm_default_field_text4'),
|
|
136
136
|
colorTemperature: 50,
|
|
137
137
|
brightness: 80,
|
|
@@ -151,7 +151,7 @@ export function getDefBiorhythmUIState(): BiorhythmBean {
|
|
|
151
151
|
{
|
|
152
152
|
id: 4,
|
|
153
153
|
icon: icon4,
|
|
154
|
-
|
|
154
|
+
time: 1410,
|
|
155
155
|
name: I18n.getLang('bio_ryhthm_default_field_text5'),
|
|
156
156
|
colorTemperature: 0,
|
|
157
157
|
brightness: 0,
|