From f30b7b083165737bb1bf64e96e12977049857a87 Mon Sep 17 00:00:00 2001 From: Faris Armoush Date: Mon, 28 Apr 2025 10:02:41 +0300 Subject: [PATCH 1/2] Fixed routines bug where it threw 404 because of a developer error. --- lib/features/scene/view/routines_view.dart | 2 ++ lib/features/scene/widgets/routines_expansion_tile.dart | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/features/scene/view/routines_view.dart b/lib/features/scene/view/routines_view.dart index 9a3c46b..696612b 100644 --- a/lib/features/scene/view/routines_view.dart +++ b/lib/features/scene/view/routines_view.dart @@ -82,6 +82,7 @@ class RoutinesView extends StatelessWidget { routines: state.scenes, loadingStates: state.loadingStates, loadingSceneId: state.loadingSceneId, + disablePlayButton: false, ), RoutinesExpansionTile( title: 'Automation', @@ -90,6 +91,7 @@ class RoutinesView extends StatelessWidget { routines: state.automationList, loadingStates: state.loadingStates, loadingSceneId: state.loadingSceneId, + disablePlayButton: true, ), const SizedBox(height: 15), ], diff --git a/lib/features/scene/widgets/routines_expansion_tile.dart b/lib/features/scene/widgets/routines_expansion_tile.dart index 1a8abea..6ab412c 100644 --- a/lib/features/scene/widgets/routines_expansion_tile.dart +++ b/lib/features/scene/widgets/routines_expansion_tile.dart @@ -11,6 +11,7 @@ class RoutinesExpansionTile extends StatelessWidget { required this.emptyRoutinesMessage, required this.routines, required this.loadingStates, + required this.disablePlayButton, this.loadingSceneId, }); final String title; @@ -18,6 +19,7 @@ class RoutinesExpansionTile extends StatelessWidget { final List routines; final Map loadingStates; final String? loadingSceneId; + final bool disablePlayButton; @override Widget build(BuildContext context) { @@ -43,7 +45,7 @@ class RoutinesExpansionTile extends StatelessWidget { child: SceneGrid( scenes: routines, loadingSceneId: loadingSceneId, - disablePlayButton: false, + disablePlayButton: disablePlayButton, loadingStates: loadingStates, ), ), From 3725d28a5e2533df64f767fe634fd9b0bd1e107d Mon Sep 17 00:00:00 2001 From: mohammad Date: Mon, 28 Apr 2025 11:06:27 +0300 Subject: [PATCH 2/2] Refactor device names in scene operations data helper --- .../helper/scene_operations_data_helper.dart | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/features/scene/helper/scene_operations_data_helper.dart b/lib/features/scene/helper/scene_operations_data_helper.dart index d5bff65..2c0d6ef 100644 --- a/lib/features/scene/helper/scene_operations_data_helper.dart +++ b/lib/features/scene/helper/scene_operations_data_helper.dart @@ -841,7 +841,7 @@ mixin SceneOperationsDataHelper { action, action.deviceName, Assets.assetsIcons3GangSwitch, - 'Light 1 Switch', + 'L - Light Switch', OperationDialogType.onOff, _createOnOffOptions(), isAutomation, @@ -853,7 +853,7 @@ mixin SceneOperationsDataHelper { action, action.deviceName, Assets.twoGang, - 'Light 1 Switch', + 'L - Light Switch', OperationDialogType.onOff, _createOnOffOptions(), isAutomation, @@ -865,7 +865,7 @@ mixin SceneOperationsDataHelper { action, action.deviceName, Assets.oneGang, - 'Light 1 Switch', + 'Light Switch', OperationDialogType.onOff, _createOnOffOptions(), isAutomation, @@ -895,7 +895,7 @@ mixin SceneOperationsDataHelper { action, action.deviceName, Assets.assetsIcons3GangSwitch, - 'Light 2 Switch', + 'M - Light Switch', OperationDialogType.onOff, _createOnOffOptions(), isAutomation, @@ -907,7 +907,7 @@ mixin SceneOperationsDataHelper { action, action.deviceName, Assets.twoGang, - 'Light 2 Switch', + 'R - Light Switch', OperationDialogType.onOff, _createOnOffOptions(), isAutomation, @@ -935,7 +935,7 @@ mixin SceneOperationsDataHelper { action, action.deviceName, Assets.assetsIcons3GangSwitch, - 'Light 3 Switch', + 'R - Light Switch', OperationDialogType.onOff, _createOnOffOptions(), isAutomation, @@ -952,7 +952,7 @@ mixin SceneOperationsDataHelper { action, action.deviceName, Assets.assetsIcons3GangSwitch, - 'Light 1 CountDown', + 'L - Light CountDown', isAutomation ? OperationDialogType.integerSteps : OperationDialogType.countdown, @@ -968,7 +968,7 @@ mixin SceneOperationsDataHelper { action, action.deviceName, Assets.twoGang, - 'Light 1 CountDown', + 'L - Light CountDown', isAutomation ? OperationDialogType.integerSteps : OperationDialogType.countdown, @@ -1006,7 +1006,7 @@ mixin SceneOperationsDataHelper { action, action.deviceName, Assets.assetsIcons3GangSwitch, - 'Light 2 CountDown', + 'M - Light CountDown', isAutomation ? OperationDialogType.integerSteps : OperationDialogType.countdown, @@ -1022,7 +1022,7 @@ mixin SceneOperationsDataHelper { action, action.deviceName, Assets.twoGang, - 'Light 2 CountDown', + 'R - Light CountDown', isAutomation ? OperationDialogType.integerSteps : OperationDialogType.countdown, @@ -1058,7 +1058,7 @@ mixin SceneOperationsDataHelper { action, action.deviceName, Assets.assetsIcons3GangSwitch, - 'Light 3 CountDown', + 'R - Light CountDown', isAutomation ? OperationDialogType.integerSteps : OperationDialogType.countdown,