@ledvance/ui-biz-bundle 1.1.123 → 1.1.125
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/flags/FlagEditPage.tsx +3 -3
- package/src/modules/flags/FlagPage.tsx +1 -1
- package/src/modules/history/HistoryPage.tsx +19 -3
- package/src/modules/mood/DynamicMoodEditorPage.tsx +5 -5
- package/src/modules/mood/FantasyMoodEditPage.tsx +3 -3
- package/src/modules/mood/MixMood/MixMoodEditPage.tsx +6 -6
- package/src/modules/mood/MixMood/MixMoodItem.tsx +2 -2
- package/src/modules/music/MusicDataBean.ts +4 -4
- package/src/modules/music/MusicPage.tsx +2 -2
- package/src/modules/timeSchedule/DeviceState.tsx +2 -2
- package/src/modules/timeSchedule/TimeScheduleEditpage.tsx +11 -11
- package/src/modules/timeSchedule/TimeSchedulePage.tsx +1 -1
- package/src/modules/timer/TimerPage.tsx +3 -3
- package/src/newModules/biorhythm/BiorhythmActions.ts +11 -11
- package/src/newModules/biorhythm/BiorhythmBean.ts +6 -6
- package/src/newModules/biorhythm/BiorhythmEditPage.tsx +3 -4
- package/src/newModules/biorhythm/BiorhythmPage.tsx +8 -9
- package/src/newModules/biorhythm/IconSelect.tsx +1 -1
- package/src/newModules/biorhythm/circular/ItemIcon.tsx +1 -1
- package/src/newModules/biorhythm/circular/Progress.tsx +2 -2
- package/src/newModules/biorhythm/circular/TimeCircular.tsx +4 -4
- package/src/newModules/biorhythm/iconListData.ts +26 -26
- package/src/newModules/childLock/ChildLockPage.tsx +1 -1
- package/src/newModules/diyScene/DiySceneEditorPage.tsx +4 -4
- package/src/newModules/diyScene/DiyScenePage.tsx +1 -1
- package/src/newModules/energyConsumption/EnergyConsumptionActions.ts +1 -1
- package/src/newModules/energyConsumption/EnergyConsumptionChart.tsx +2 -2
- package/src/newModules/energyConsumption/EnergyConsumptionDetail.tsx +3 -3
- package/src/newModules/energyConsumption/EnergyConsumptionPage.tsx +4 -4
- package/src/newModules/energyConsumption/component/DateSwitch.tsx +4 -4
- package/src/newModules/energyConsumption/component/EnergyModal.tsx +2 -2
- package/src/newModules/energyConsumption/component/Overview.tsx +4 -4
- package/src/newModules/fixedTime/FixedTimeDetailPage.tsx +3 -3
- package/src/newModules/mood/DynamicMoodEditorPage.tsx +3 -3
- package/src/newModules/mood/MixDynamicMoodEditor.tsx +6 -6
- package/src/newModules/mood/MoodItem.tsx +1 -1
- package/src/newModules/mood/MoodPage.tsx +1 -1
- package/src/newModules/randomTime/RandomTimeDetailPage.tsx +2 -2
- package/src/newModules/sleepWakeUp/SleepWakeUpPage.tsx +15 -15
- package/src/newModules/timeSchedule/TimeScheduleDetailPage.tsx +2 -2
- package/src/modules/biorhythm/BiorhythmActions.d.ts +0 -8
- package/src/modules/biorhythm/BiorhythmActions.ts +0 -324
- package/src/modules/biorhythm/BiorhythmBean.d.ts +0 -58
- package/src/modules/biorhythm/BiorhythmBean.ts +0 -230
- package/src/modules/biorhythm/BiorhythmEditPage.d.ts +0 -14
- package/src/modules/biorhythm/BiorhythmEditPage.tsx +0 -324
- package/src/modules/biorhythm/BiorhythmPage.d.ts +0 -10
- package/src/modules/biorhythm/BiorhythmPage.tsx +0 -796
- package/src/modules/biorhythm/IconSelect.d.ts +0 -2
- package/src/modules/biorhythm/IconSelect.tsx +0 -82
- package/src/modules/biorhythm/Router.ts +0 -34
- package/src/modules/biorhythm/circular/ItemIcon.d.ts +0 -22
- package/src/modules/biorhythm/circular/ItemIcon.tsx +0 -173
- package/src/modules/biorhythm/circular/Progress.d.ts +0 -24
- package/src/modules/biorhythm/circular/Progress.tsx +0 -412
- package/src/modules/biorhythm/circular/TimeCircular.d.ts +0 -11
- package/src/modules/biorhythm/circular/TimeCircular.tsx +0 -70
- package/src/modules/biorhythm/circular/biorhythm_plantimer.png +0 -0
- package/src/modules/biorhythm/circular/rhythm_icon.png +0 -0
- package/src/modules/biorhythm/iconListData.d.ts +0 -7
- package/src/modules/biorhythm/iconListData.ts +0 -30
- package/src/modules/biorhythm/pIdList.d.ts +0 -2
- package/src/modules/biorhythm/pIdList.ts +0 -36
- package/src/modules/biorhythm/res/BiologicalRes.d.ts +0 -43
- package/src/modules/biorhythm/res/BiologicalRes.ts +0 -42
- package/src/modules/biorhythm/res/Biological_Rhythm.png +0 -0
- package/src/modules/biorhythm/res/Biological_Rhythm_12.png +0 -0
- package/src/modules/biorhythm/res/Biological_Rhythm_new.png +0 -0
- package/src/modules/biorhythm/res/Biological_Rhythm_new_12.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedAccountGroups.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedAccountGroups@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedAccountGroups@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedArrowsNavAdd.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedArrowsNavAdd@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedArrowsNavAdd@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedArrowsNavArrowForwardIos.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedArrowsNavArrowForwardIos@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedArrowsNavArrowForwardIos@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedBuildingsHome.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedBuildingsHome@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedBuildingsHome@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedEditorFavoriteBorder.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedEditorFavoriteBorder@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedEditorFavoriteBorder@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherBed.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherBed@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherBed@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherBusinessCenter.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherBusinessCenter@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherBusinessCenter@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherChair.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherChair@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherChair@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherCoffee.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherCoffee@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherCoffee@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherDirectionsCar.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherDirectionsCar@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherDirectionsCar@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherFitnessCenter.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherFitnessCenter@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherFitnessCenter@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherHeadphones.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherHeadphones@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherHeadphones@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherMenuBook.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherMenuBook@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherMenuBook@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherMusicNote.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherMusicNote@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherMusicNote@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherNotificationsNone.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherNotificationsNone@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherNotificationsNone@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherPottedPlant.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherPottedPlant@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherPottedPlant@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherRestaurant.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherRestaurant@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherRestaurant@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherSentimentSatisfied.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherSentimentSatisfied@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherSentimentSatisfied@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherSportsEsports.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherSportsEsports@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherSportsEsports@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherTv.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherTv@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherTv@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedTimeAccessAlarm.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedTimeAccessAlarm@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedTimeAccessAlarm@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherBedtime.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherBedtime@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherBedtime@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherPartlyCloudyDay.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherPartlyCloudyDay@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherPartlyCloudyDay@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherStarOutline.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherStarOutline@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherStarOutline@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherWbSunny.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherWbSunny@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherWbSunny@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherWbTwilight.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherWbTwilight@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherWbTwilight@3x.png +0 -0
- package/src/modules/fixedTime/FixedTimeActions.ts +0 -173
- package/src/modules/fixedTime/FixedTimeDetailPage.tsx +0 -373
- package/src/modules/fixedTime/FixedTimePage.tsx +0 -214
- package/src/modules/fixedTime/Router.ts +0 -26
- package/src/modules/music/res/app_music_ball@2x.png +0 -0
- package/src/modules/music/res/app_music_ball@3x.png +0 -0
- package/src/modules/music/res/app_music_game@2x.png +0 -0
- package/src/modules/music/res/app_music_game@3x.png +0 -0
- package/src/modules/music/res/app_music_music@2x.png +0 -0
- package/src/modules/music/res/app_music_music@3x.png +0 -0
- package/src/modules/music/res/app_music_romantic@2x.png +0 -0
- package/src/modules/music/res/app_music_romantic@3x.png +0 -0
- package/src/modules/music/res/iconsMaterialOutlinedArrowsNavCheck.png +0 -0
- package/src/modules/music/res/iconsMaterialOutlinedArrowsNavCheck@2x.png +0 -0
- package/src/modules/music/res/iconsMaterialOutlinedArrowsNavCheck@3x.png +0 -0
- package/src/modules/music/res/illustrationsFeaturesMusic-dark.png +0 -0
- package/src/modules/music/res/illustrationsFeaturesMusic-dark@2x.png +0 -0
- package/src/modules/music/res/illustrationsFeaturesMusic-dark@3x.png +0 -0
- package/src/modules/music/res/illustrationsFeaturesMusic.png +0 -0
- package/src/modules/music/res/illustrationsFeaturesMusic@2x.png +0 -0
- package/src/modules/music/res/illustrationsFeaturesMusic@3x.png +0 -0
- package/src/modules/music/res/illustrationsFeaturesMusicDisabled.png +0 -0
- package/src/modules/music/res/illustrationsFeaturesMusicDisabled@2x.png +0 -0
- package/src/modules/music/res/illustrationsFeaturesMusicDisabled@3x.png +0 -0
- package/src/modules/music/res/index.d.ts +0 -10
- package/src/modules/music/res/index.ts +0 -10
- package/src/modules/powerOnBehavior/PowerOnBehaviorActions.ts +0 -12
- package/src/modules/powerOnBehavior/PowerOnBehaviorPage.tsx +0 -173
- package/src/modules/powerOnBehavior/Router.ts +0 -16
- package/src/modules/randomTime/RandomTimeActions.ts +0 -160
- package/src/modules/randomTime/RandomTimeDetailPage.tsx +0 -338
- package/src/modules/randomTime/RandomTimePage.tsx +0 -215
- package/src/modules/randomTime/Router.ts +0 -25
- package/src/modules/randomTime/Summary.tsx +0 -123
- package/src/modules/sleepWakeup/DeviceState.d.ts +0 -9
- package/src/modules/sleepWakeup/DeviceState.tsx +0 -100
- package/src/modules/sleepWakeup/LdvScheduleItem.d.ts +0 -15
- package/src/modules/sleepWakeup/LdvScheduleItem.tsx +0 -176
- package/src/modules/sleepWakeup/Router.ts +0 -25
- package/src/modules/sleepWakeup/SleepWakeUpActions.d.ts +0 -2
- package/src/modules/sleepWakeup/SleepWakeUpActions.ts +0 -180
- package/src/modules/sleepWakeup/SleepWakeUpDetailPage.d.ts +0 -2
- package/src/modules/sleepWakeup/SleepWakeUpDetailPage.tsx +0 -617
- package/src/modules/sleepWakeup/SleepWakeUpPage.d.ts +0 -13
- package/src/modules/sleepWakeup/SleepWakeUpPage.tsx +0 -425
- package/src/modules/sleepWakeup/utils.d.ts +0 -44
- package/src/modules/sleepWakeup/utils.ts +0 -254
- package/src/newModules/biorhythm/circular/biorhythm_plantimer.png +0 -0
- package/src/newModules/biorhythm/circular/rhythm_icon.png +0 -0
- package/src/newModules/biorhythm/res/BiologicalRes.d.ts +0 -43
- package/src/newModules/biorhythm/res/BiologicalRes.ts +0 -42
- package/src/newModules/biorhythm/res/Biological_Rhythm.png +0 -0
- package/src/newModules/biorhythm/res/Biological_Rhythm_12.png +0 -0
- package/src/newModules/biorhythm/res/Biological_Rhythm_new.png +0 -0
- package/src/newModules/biorhythm/res/Biological_Rhythm_new_12.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedAccountGroups.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedAccountGroups@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedAccountGroups@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedArrowsNavAdd.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedArrowsNavAdd@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedArrowsNavAdd@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedArrowsNavArrowForwardIos.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedArrowsNavArrowForwardIos@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedArrowsNavArrowForwardIos@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedBuildingsHome.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedBuildingsHome@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedBuildingsHome@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedEditorFavoriteBorder.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedEditorFavoriteBorder@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedEditorFavoriteBorder@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherBed.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherBed@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherBed@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherBusinessCenter.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherBusinessCenter@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherBusinessCenter@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherChair.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherChair@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherChair@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherCoffee.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherCoffee@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherCoffee@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherDirectionsCar.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherDirectionsCar@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherDirectionsCar@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherFitnessCenter.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherFitnessCenter@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherFitnessCenter@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherHeadphones.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherHeadphones@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherHeadphones@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherMenuBook.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherMenuBook@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherMenuBook@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherMusicNote.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherMusicNote@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherMusicNote@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherNotificationsNone.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherNotificationsNone@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherNotificationsNone@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherPottedPlant.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherPottedPlant@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherPottedPlant@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherRestaurant.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherRestaurant@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherRestaurant@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherSentimentSatisfied.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherSentimentSatisfied@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherSentimentSatisfied@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherSportsEsports.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherSportsEsports@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherSportsEsports@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherTv.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherTv@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherTv@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedTimeAccessAlarm.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedTimeAccessAlarm@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedTimeAccessAlarm@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherBedtime.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherBedtime@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherBedtime@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherPartlyCloudyDay.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherPartlyCloudyDay@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherPartlyCloudyDay@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherStarOutline.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherStarOutline@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherStarOutline@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherWbSunny.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherWbSunny@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherWbSunny@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherWbTwilight.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherWbTwilight@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherWbTwilight@3x.png +0 -0
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { JudgeTimeScheduleProps } from "@ledvance/ui-biz-bundle/src/modules/timeSchedule/TimeScheduleBean";
|
|
2
|
-
interface DeviceStateProps extends JudgeTimeScheduleProps {
|
|
3
|
-
mixActions: any;
|
|
4
|
-
singleActions: any;
|
|
5
|
-
editSingleFn: (v: any) => void;
|
|
6
|
-
editMixFn: (v: any) => void;
|
|
7
|
-
}
|
|
8
|
-
declare const DeviceState: (props: DeviceStateProps) => any;
|
|
9
|
-
export default DeviceState;
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import React, { useCallback } from "react";
|
|
2
|
-
import LampAdjustView from "@ledvance/base/src/components/LampAdjustView";
|
|
3
|
-
import { JudgeTimeScheduleProps } from "../timeSchedule/TimeScheduleBean";
|
|
4
|
-
import MixLightView from "../timeSchedule/mix/MixLightView";
|
|
5
|
-
import Card from "@ledvance/base/src/components/Card";
|
|
6
|
-
import LdvSwitch from "@ledvance/base/src/components/ldvSwitch";
|
|
7
|
-
import I18n from "@ledvance/base/src/i18n";
|
|
8
|
-
import { hsv2Hex, mapFloatToRange } from "@ledvance/base/src/utils";
|
|
9
|
-
import { cctToColor } from "@ledvance/base/src/utils/cctUtils";
|
|
10
|
-
import { Utils } from "tuya-panel-kit";
|
|
11
|
-
|
|
12
|
-
const { convertX: cx } = Utils.RatioUtils
|
|
13
|
-
|
|
14
|
-
interface DeviceStateProps extends JudgeTimeScheduleProps {
|
|
15
|
-
mixActions: any
|
|
16
|
-
singleActions: any
|
|
17
|
-
editSingleFn: (v: any) => void
|
|
18
|
-
editMixFn: (v: any) => void
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const DeviceState = (props: DeviceStateProps) => {
|
|
22
|
-
|
|
23
|
-
const setWorkModeStateAction = useCallback((isColor: boolean) => {
|
|
24
|
-
props.editSingleFn({
|
|
25
|
-
...props.singleActions,
|
|
26
|
-
isColor
|
|
27
|
-
})
|
|
28
|
-
}, [props.singleActions])
|
|
29
|
-
|
|
30
|
-
const setColourStateAction = useCallback((h, s, v) => {
|
|
31
|
-
props.editSingleFn({
|
|
32
|
-
...props.singleActions,
|
|
33
|
-
h,
|
|
34
|
-
s,
|
|
35
|
-
v
|
|
36
|
-
})
|
|
37
|
-
}, [props.singleActions])
|
|
38
|
-
|
|
39
|
-
const setTemperatureStateAction = useCallback((temperature) => {
|
|
40
|
-
props.editSingleFn({
|
|
41
|
-
...props.singleActions,
|
|
42
|
-
temperature
|
|
43
|
-
})
|
|
44
|
-
}, [props.singleActions])
|
|
45
|
-
|
|
46
|
-
const setBrightnessStateAction = useCallback((brightness) => {
|
|
47
|
-
props.editSingleFn({
|
|
48
|
-
...props.singleActions,
|
|
49
|
-
brightness
|
|
50
|
-
})
|
|
51
|
-
}, [props.singleActions])
|
|
52
|
-
|
|
53
|
-
const getColorBlockColor = useCallback(() => {
|
|
54
|
-
const s = Math.round(mapFloatToRange(props.singleActions.s / 100, 30, 100))
|
|
55
|
-
if(props.isSupportColor && props.singleActions.isColor){
|
|
56
|
-
return hsv2Hex(props.singleActions.h, s, 100)
|
|
57
|
-
}
|
|
58
|
-
if(props.isSupportTemperature){
|
|
59
|
-
return cctToColor(props.singleActions.temperature.toFixed())
|
|
60
|
-
}
|
|
61
|
-
return '#fff'
|
|
62
|
-
}, [props.singleActions])
|
|
63
|
-
return (
|
|
64
|
-
props.isMixRGBWLamp ?
|
|
65
|
-
<MixLightView
|
|
66
|
-
mixActions={props.mixActions}
|
|
67
|
-
setSendDps={(v) => props.editMixFn(v)}
|
|
68
|
-
mutuallyExclusive={true}
|
|
69
|
-
/> :
|
|
70
|
-
<Card style={{marginHorizontal: cx(24)}}>
|
|
71
|
-
<LdvSwitch
|
|
72
|
-
title={I18n.getLang('light_sources_tile_tw_lighting_headline')}
|
|
73
|
-
color={getColorBlockColor()}
|
|
74
|
-
colorAlpha={1}
|
|
75
|
-
enable={true}
|
|
76
|
-
setEnable={() => {}}
|
|
77
|
-
showSwitch={false}
|
|
78
|
-
/>
|
|
79
|
-
<LampAdjustView
|
|
80
|
-
isSupportColor={!!props.isSupportColor}
|
|
81
|
-
isSupportBrightness={!!props.isSupportBrightness}
|
|
82
|
-
isSupportTemperature={!!props.isSupportTemperature}
|
|
83
|
-
isColorMode={props.singleActions.isColor}
|
|
84
|
-
setIsColorMode={setWorkModeStateAction}
|
|
85
|
-
reserveSV={true}
|
|
86
|
-
minBrightness={1}
|
|
87
|
-
h={props.singleActions.h}
|
|
88
|
-
s={props.singleActions.s}
|
|
89
|
-
v={props.singleActions.v}
|
|
90
|
-
onHSVChangeComplete={setColourStateAction}
|
|
91
|
-
colorTemp={props.singleActions.temperature}
|
|
92
|
-
brightness={props.singleActions.brightness}
|
|
93
|
-
onCCTChangeComplete={setTemperatureStateAction}
|
|
94
|
-
onBrightnessChangeComplete={setBrightnessStateAction}
|
|
95
|
-
/>
|
|
96
|
-
</Card>
|
|
97
|
-
)
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export default DeviceState
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ViewStyle } from 'react-native';
|
|
2
|
-
interface LdvScheduleItemProps {
|
|
3
|
-
item: any;
|
|
4
|
-
tags?: {
|
|
5
|
-
label: string;
|
|
6
|
-
value: string;
|
|
7
|
-
dpId: string;
|
|
8
|
-
}[];
|
|
9
|
-
style?: ViewStyle;
|
|
10
|
-
onEnableChange: (enable: boolean) => void;
|
|
11
|
-
onPress: (item: any) => void;
|
|
12
|
-
onLongPress: (item: any) => void;
|
|
13
|
-
}
|
|
14
|
-
declare const LdvScheduleItem: (props: LdvScheduleItemProps) => any;
|
|
15
|
-
export default LdvScheduleItem;
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import React, { useCallback } from 'react';
|
|
2
|
-
import { StyleSheet, Text, View, ViewStyle } from 'react-native';
|
|
3
|
-
import { SwitchButton, Utils } from 'tuya-panel-kit';
|
|
4
|
-
import { loopText } from '@ledvance/base/src/utils/common';
|
|
5
|
-
import Card from '@ledvance/base/src/components/Card';
|
|
6
|
-
import I18n from '@ledvance/base/src/i18n';
|
|
7
|
-
const { convertX } = Utils.RatioUtils;
|
|
8
|
-
const { parseTimer } = Utils.TimeUtils
|
|
9
|
-
|
|
10
|
-
interface LdvScheduleItemProps {
|
|
11
|
-
item: any
|
|
12
|
-
tags?: {
|
|
13
|
-
label: string
|
|
14
|
-
value: string
|
|
15
|
-
dpId: string
|
|
16
|
-
}[]
|
|
17
|
-
style?: ViewStyle
|
|
18
|
-
onEnableChange: (enable: boolean) => void
|
|
19
|
-
onPress: (item: any) => void
|
|
20
|
-
onLongPress: (item: any) => void
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const LdvScheduleItem = (props: LdvScheduleItemProps) => {
|
|
24
|
-
const { item, style, onEnableChange, onPress, onLongPress } = props;
|
|
25
|
-
|
|
26
|
-
const getSleepTimeString = useCallback((item) => {
|
|
27
|
-
const { time, fade } = item
|
|
28
|
-
const prefixString = time[0].toString().padStart(2, '0') + ':' + time[1].toString().padStart(2, '0')
|
|
29
|
-
|
|
30
|
-
let suffixHour = parseInt(time[0] + fade / 60)
|
|
31
|
-
let suffixMinute = parseInt(time[1] + fade % 60)
|
|
32
|
-
/// 先计算分钟数
|
|
33
|
-
if (suffixMinute > 59) {
|
|
34
|
-
/// 超过59
|
|
35
|
-
suffixMinute = suffixMinute - 60
|
|
36
|
-
/// 分钟超过60,小时进一
|
|
37
|
-
suffixHour = suffixHour + 1
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
if (suffixHour > 23) {
|
|
41
|
-
/// 总小时数超过24,进一天
|
|
42
|
-
suffixHour = suffixHour - 24
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const suffixHourString = suffixHour.toString().padStart(2, '0')
|
|
46
|
-
const suffixMinuteString = suffixMinute.toString().padStart(2, '0')
|
|
47
|
-
const suffixString = suffixHourString + ':' + suffixMinuteString
|
|
48
|
-
return prefixString + ' - ' + suffixString
|
|
49
|
-
}, [])
|
|
50
|
-
|
|
51
|
-
const getWakeUpTimeString = useCallback((item) => {
|
|
52
|
-
const { time, fade } = item
|
|
53
|
-
|
|
54
|
-
let prefixHour = Math.trunc(time[0] - Math.trunc(fade / 60))
|
|
55
|
-
let prefixMinute = Math.trunc(time[1] - fade % 60)
|
|
56
|
-
|
|
57
|
-
if (prefixMinute < 0) {
|
|
58
|
-
prefixMinute = prefixMinute + 60
|
|
59
|
-
prefixHour = prefixHour - 1
|
|
60
|
-
}
|
|
61
|
-
if (prefixHour < 0) {
|
|
62
|
-
prefixHour = prefixHour + 24
|
|
63
|
-
}
|
|
64
|
-
const prefixString = prefixHour.toString().padStart(2, '0') + ':' + prefixMinute.toString().padStart(2, '0')
|
|
65
|
-
|
|
66
|
-
let suffixHour = Math.trunc(time[0])
|
|
67
|
-
let suffixMinute = Math.trunc(time[1])
|
|
68
|
-
|
|
69
|
-
const suffixHourString = suffixHour.toString().padStart(2, '0')
|
|
70
|
-
const suffixMinuteString = suffixMinute.toString().padStart(2, '0')
|
|
71
|
-
const suffixString = suffixHourString + ':' + suffixMinuteString
|
|
72
|
-
return prefixString + ' - ' + suffixString
|
|
73
|
-
}, [])
|
|
74
|
-
|
|
75
|
-
return (
|
|
76
|
-
<Card
|
|
77
|
-
style={styles.card}
|
|
78
|
-
containerStyle={[styles.container, style]}
|
|
79
|
-
onPress={() => {
|
|
80
|
-
onPress(item);
|
|
81
|
-
}}
|
|
82
|
-
onLongPress={() => {
|
|
83
|
-
onPress(item);
|
|
84
|
-
// onLongPress(item);
|
|
85
|
-
}}>
|
|
86
|
-
<View style={styles.infoContainer}>
|
|
87
|
-
<Text style={styles.time}>
|
|
88
|
-
{item.isSleep ? getSleepTimeString(item) : getWakeUpTimeString(item)}
|
|
89
|
-
</Text>
|
|
90
|
-
<Text style={styles.loop}>
|
|
91
|
-
{loopText(item.loops, parseTimer((item.time[0] * 60 + item.time[1]) * 60))}
|
|
92
|
-
</Text>
|
|
93
|
-
<Text style={styles.name}>{item.name}</Text>
|
|
94
|
-
<View style={styles.typeContainer}>
|
|
95
|
-
<View style={styles.tag}>
|
|
96
|
-
<Text style={styles.tagTitile}>
|
|
97
|
-
{I18n.getLang(item.isSleep ? 'sleepwakeschedule_field_3_Times_chips2_text' : 'sleepwakeschedule_field_3_Times_chips_text')}
|
|
98
|
-
</Text>
|
|
99
|
-
</View>
|
|
100
|
-
</View>
|
|
101
|
-
</View>
|
|
102
|
-
<View style={styles.switchContainer}>
|
|
103
|
-
<SwitchButton
|
|
104
|
-
value={!!item.enable}
|
|
105
|
-
thumbStyle={{ elevation: 0 }}
|
|
106
|
-
onValueChange={() => {
|
|
107
|
-
onEnableChange(item);
|
|
108
|
-
}}
|
|
109
|
-
/>
|
|
110
|
-
</View>
|
|
111
|
-
</Card>
|
|
112
|
-
);
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
const styles = StyleSheet.create({
|
|
116
|
-
card: {
|
|
117
|
-
marginHorizontal: convertX(24),
|
|
118
|
-
marginTop: convertX(8),
|
|
119
|
-
// marginBottom: convertX(15),
|
|
120
|
-
borderRadius: convertX(8),
|
|
121
|
-
},
|
|
122
|
-
container: {
|
|
123
|
-
flexDirection: 'row',
|
|
124
|
-
justifyContent: 'space-between',
|
|
125
|
-
},
|
|
126
|
-
infoContainer: {
|
|
127
|
-
flex: 1,
|
|
128
|
-
marginTop: convertX(16),
|
|
129
|
-
marginBottom: convertX(16),
|
|
130
|
-
flexDirection: 'column',
|
|
131
|
-
marginLeft: convertX(16),
|
|
132
|
-
},
|
|
133
|
-
time: {
|
|
134
|
-
marginBottom: convertX(5),
|
|
135
|
-
fontSize: 16,
|
|
136
|
-
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
137
|
-
fontWeight: 'bold',
|
|
138
|
-
},
|
|
139
|
-
loop: {
|
|
140
|
-
color: '#000',
|
|
141
|
-
fontSize: convertX(14),
|
|
142
|
-
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
143
|
-
marginTop: convertX(8),
|
|
144
|
-
},
|
|
145
|
-
name: {
|
|
146
|
-
color: '#000',
|
|
147
|
-
fontSize: convertX(14),
|
|
148
|
-
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
149
|
-
marginTop: convertX(8),
|
|
150
|
-
},
|
|
151
|
-
switchContainer: {
|
|
152
|
-
marginRight: convertX(16),
|
|
153
|
-
// backgroundColor: 'red',
|
|
154
|
-
marginTop: convertX(16),
|
|
155
|
-
},
|
|
156
|
-
switch: {},
|
|
157
|
-
typeContainer: {
|
|
158
|
-
flexDirection: 'row',
|
|
159
|
-
marginTop: convertX(8),
|
|
160
|
-
},
|
|
161
|
-
tag: {
|
|
162
|
-
borderRadius: convertX(16),
|
|
163
|
-
height: convertX(16),
|
|
164
|
-
backgroundColor: 'rgb(230,231,232)',
|
|
165
|
-
marginRight: convertX(10),
|
|
166
|
-
paddingLeft: convertX(10),
|
|
167
|
-
paddingRight: convertX(10),
|
|
168
|
-
},
|
|
169
|
-
tagTitile: {
|
|
170
|
-
fontSize: convertX(10),
|
|
171
|
-
textAlign: 'center',
|
|
172
|
-
fontFamily: 'PingFangSC-Medium',
|
|
173
|
-
},
|
|
174
|
-
});
|
|
175
|
-
|
|
176
|
-
export default LdvScheduleItem;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import {NavigationRoute} from "tuya-panel-kit";
|
|
2
|
-
import SleepWakeUpPage from "./SleepWakeUpPage";
|
|
3
|
-
import SleepWakeUpDetailPage from "./SleepWakeUpDetailPage";
|
|
4
|
-
import {ui_biz_routerKey} from "../../navigation/Routers";
|
|
5
|
-
|
|
6
|
-
const SleepWakeUpPageRouters: NavigationRoute[] = [
|
|
7
|
-
{
|
|
8
|
-
name: ui_biz_routerKey.ui_biz_sleep_wakeUp,
|
|
9
|
-
component: SleepWakeUpPage,
|
|
10
|
-
options: {
|
|
11
|
-
hideTopbar: true,
|
|
12
|
-
showOfflineView: false,
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
name: ui_biz_routerKey.ui_biz_sleep_wakeUp_edit,
|
|
17
|
-
component: SleepWakeUpDetailPage,
|
|
18
|
-
options: {
|
|
19
|
-
hideTopbar: true,
|
|
20
|
-
showOfflineView: false,
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
]
|
|
24
|
-
|
|
25
|
-
export default SleepWakeUpPageRouters
|
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react'
|
|
2
|
-
import { useDp, useDeviceId } from '@ledvance/base/src/models/modules/NativePropsSlice'
|
|
3
|
-
import { getFeature, putFeature } from '@ledvance/base/src/api/native'
|
|
4
|
-
import { decodeSleepString, highInTheCloudsSleepString, highInTheCloudsWakeString, decodeWakeUpString, encodeSleep, encodeWakeUp, encodeSingleSleepPlan, encodeSingleWakeUpPlan } from './utils'
|
|
5
|
-
const sleepPlanFeatureId = 'SleepPlan'
|
|
6
|
-
const wakeUpPlanFeatureId = 'WakeUpPlan'
|
|
7
|
-
|
|
8
|
-
// 接口失败重试
|
|
9
|
-
let retryNumber = 0
|
|
10
|
-
const putFeatureFn = async (devId, featureId, data) => {
|
|
11
|
-
let status;
|
|
12
|
-
await putFeature(devId, featureId, data).then(res => {
|
|
13
|
-
if (!res?.result && retryNumber < 3) {
|
|
14
|
-
retryNumber += 1
|
|
15
|
-
putFeatureFn(devId, featureId, data).then()
|
|
16
|
-
}
|
|
17
|
-
if (res?.result) {
|
|
18
|
-
retryNumber = 0
|
|
19
|
-
status = res?.result
|
|
20
|
-
}
|
|
21
|
-
})
|
|
22
|
-
return status
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export const useSleepPlan = (dpCodes: Record<string, string>, disableFeature?: boolean) => {
|
|
26
|
-
const deviceId = useDeviceId()
|
|
27
|
-
const [uiData, setUiData] = useState([] as any)
|
|
28
|
-
const [sleepPlan, setSleepPlan]: any = useDp(dpCodes.sleep_mode);
|
|
29
|
-
// 获取云端数据
|
|
30
|
-
useEffect(() => {
|
|
31
|
-
if(disableFeature){
|
|
32
|
-
const dpData = decodeSleepString(sleepPlan)
|
|
33
|
-
setUiData(dpData)
|
|
34
|
-
}else{
|
|
35
|
-
getFeature(deviceId, sleepPlanFeatureId).then(res => {
|
|
36
|
-
if (res?.result) {
|
|
37
|
-
const data = res?.data
|
|
38
|
-
let list = data?.map(item => { return { ...item, startTime: (item?.startTime || item?.v) && JSON.parse(item?.startTime || item?.v)?.dp || '' } })
|
|
39
|
-
// 首次进入同步云端数据 (云端无数据)
|
|
40
|
-
if (!list) {
|
|
41
|
-
list = decodeSleepString(sleepPlan)
|
|
42
|
-
setSleepCloudData(list, deviceId).then()
|
|
43
|
-
setUiData(list)
|
|
44
|
-
return
|
|
45
|
-
}
|
|
46
|
-
const dpData = decodeSleepString(sleepPlan)
|
|
47
|
-
const sleepCloudData = highInTheCloudsSleepString(list)
|
|
48
|
-
// 更新
|
|
49
|
-
if (sleepCloudData?.length === dpData?.length) {
|
|
50
|
-
const list = dpData?.map((item, index) => {
|
|
51
|
-
return { ...item, name: sleepCloudData[index]?.name }
|
|
52
|
-
})
|
|
53
|
-
setSleepCloudData(list, deviceId).then()
|
|
54
|
-
setUiData(list)
|
|
55
|
-
return
|
|
56
|
-
}
|
|
57
|
-
setUiData(highInTheCloudsSleepString(list))
|
|
58
|
-
}
|
|
59
|
-
})
|
|
60
|
-
}
|
|
61
|
-
}, [sleepPlan])
|
|
62
|
-
|
|
63
|
-
const setSleepList = async (sleepPlan: any[]) => {
|
|
64
|
-
const sleepData = sleepPlan.map(item => ({
|
|
65
|
-
name: item.name,
|
|
66
|
-
startTime: JSON.stringify({ dp: encodeSingleSleepPlan(item) })
|
|
67
|
-
}))
|
|
68
|
-
let res
|
|
69
|
-
const setCloudStatus = await putFeatureFn(deviceId, sleepPlanFeatureId, sleepData)
|
|
70
|
-
if (setCloudStatus) {
|
|
71
|
-
const hex = encodeSleep(sleepPlan)
|
|
72
|
-
res = await setSleepPlan(hex)
|
|
73
|
-
}
|
|
74
|
-
if (res && res?.result) {
|
|
75
|
-
/// success
|
|
76
|
-
return {
|
|
77
|
-
result: { success: true },
|
|
78
|
-
// dps: { [dpCodes.wakeup_mode]: hex },
|
|
79
|
-
}
|
|
80
|
-
} else {
|
|
81
|
-
/// failure
|
|
82
|
-
return {
|
|
83
|
-
result: { success: false },
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
return [uiData, setSleepList];
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export const useWakeUpPlan = (dpCodes: Record<string, string>, disableFeature?: boolean) => {
|
|
92
|
-
const deviceId = useDeviceId()
|
|
93
|
-
const [uiData, setUiData] = useState([] as any)
|
|
94
|
-
const [wakeUpPlan, setWakeUpPlan]: any = useDp(dpCodes.wakeup_mode)
|
|
95
|
-
// 获取云端数据
|
|
96
|
-
useEffect(() => {
|
|
97
|
-
if(disableFeature){
|
|
98
|
-
const dpData = decodeWakeUpString(wakeUpPlan)
|
|
99
|
-
setUiData(dpData)
|
|
100
|
-
}else{
|
|
101
|
-
getFeature(deviceId, wakeUpPlanFeatureId).then(res => {
|
|
102
|
-
if (res?.result) {
|
|
103
|
-
const data = res?.data
|
|
104
|
-
let list = data?.map(item => { return { ...item, startTime: (item?.startTime || item?.v) && JSON.parse(item?.startTime || item?.v)?.dp || '' } })
|
|
105
|
-
// 首次进入同步云端数据 (云端无数据)
|
|
106
|
-
if (!list) {
|
|
107
|
-
list = decodeWakeUpString(wakeUpPlan)
|
|
108
|
-
setWakeCloudData(list, deviceId).then()
|
|
109
|
-
setUiData(list)
|
|
110
|
-
return
|
|
111
|
-
}
|
|
112
|
-
const dpData = decodeWakeUpString(wakeUpPlan)
|
|
113
|
-
const wakeCloudData = highInTheCloudsWakeString(list)
|
|
114
|
-
// 更新
|
|
115
|
-
if (wakeCloudData?.length === dpData?.length) {
|
|
116
|
-
const list = dpData?.map((item, index) => {
|
|
117
|
-
return { ...item, name: wakeCloudData[index]?.name }
|
|
118
|
-
})
|
|
119
|
-
setWakeCloudData(list, deviceId).then()
|
|
120
|
-
setUiData(list)
|
|
121
|
-
return
|
|
122
|
-
}
|
|
123
|
-
setUiData(highInTheCloudsWakeString(list))
|
|
124
|
-
}
|
|
125
|
-
})
|
|
126
|
-
}
|
|
127
|
-
}, [wakeUpPlan])
|
|
128
|
-
|
|
129
|
-
const setWakeUpList = async (wakeUpPlan) => {
|
|
130
|
-
const wakeUpData = wakeUpPlan.map(item => ({
|
|
131
|
-
name: item.name,
|
|
132
|
-
startTime: JSON.stringify({ dp: encodeSingleSleepPlan(item) })
|
|
133
|
-
}))
|
|
134
|
-
let res: any
|
|
135
|
-
const setCloudStatus = await putFeatureFn(deviceId, wakeUpPlanFeatureId, wakeUpData)
|
|
136
|
-
if (setCloudStatus) {
|
|
137
|
-
const hex = encodeWakeUp(wakeUpPlan)
|
|
138
|
-
res = await setWakeUpPlan(hex)
|
|
139
|
-
}
|
|
140
|
-
if (res && res?.result) {
|
|
141
|
-
/// success
|
|
142
|
-
return {
|
|
143
|
-
result: { success: true },
|
|
144
|
-
// dps: { [dpCodes.wakeup_mode]: hex },
|
|
145
|
-
}
|
|
146
|
-
} else {
|
|
147
|
-
/// failure
|
|
148
|
-
return {
|
|
149
|
-
result: { success: false },
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
return [uiData, setWakeUpList];
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
// 设置云端数据 wakeUp
|
|
157
|
-
const setWakeCloudData = async (list, devId) => {
|
|
158
|
-
const listData: any = []
|
|
159
|
-
list?.forEach(item => {
|
|
160
|
-
listData?.push({
|
|
161
|
-
name: item?.name,
|
|
162
|
-
startTime: JSON.stringify({ dp: encodeSingleWakeUpPlan(item) })
|
|
163
|
-
})
|
|
164
|
-
})
|
|
165
|
-
const res = await putFeatureFn(devId, wakeUpPlanFeatureId, listData)
|
|
166
|
-
return res
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
// 设置云端数据 sleep
|
|
170
|
-
const setSleepCloudData = async (list, devId) => {
|
|
171
|
-
const listData: any = []
|
|
172
|
-
list.forEach(item => {
|
|
173
|
-
listData?.push({
|
|
174
|
-
name: item?.name,
|
|
175
|
-
startTime: JSON.stringify({ dp: encodeSingleSleepPlan(item) })
|
|
176
|
-
})
|
|
177
|
-
})
|
|
178
|
-
const res = await putFeatureFn(devId, sleepPlanFeatureId, listData)
|
|
179
|
-
return res
|
|
180
|
-
}
|