From 9b5ddc4dc86203cecb41bed21ed329e17895e32b Mon Sep 17 00:00:00 2001 From: ashrafzarkanisala Date: Wed, 27 Nov 2024 21:03:19 +0300 Subject: [PATCH] push routine details model and api settup --- .../bloc/routine_bloc/routine_bloc.dart | 2 +- .../models/routine_details_model.dart | 262 ++++++++++++++++++ lib/pages/routiens/models/routine_model.dart | 33 ++- lib/pages/routiens/view/routines_view.dart | 2 +- .../fetch_routine_scenes_automation.dart | 143 +++++----- .../main_routine_view/routine_view_card.dart | 160 +++++++---- lib/services/routines_api.dart | 81 +++--- lib/utils/constants/api_const.dart | 4 +- 8 files changed, 499 insertions(+), 188 deletions(-) create mode 100644 lib/pages/routiens/models/routine_details_model.dart diff --git a/lib/pages/routiens/bloc/routine_bloc/routine_bloc.dart b/lib/pages/routiens/bloc/routine_bloc/routine_bloc.dart index 8506171b..d857de76 100644 --- a/lib/pages/routiens/bloc/routine_bloc/routine_bloc.dart +++ b/lib/pages/routiens/bloc/routine_bloc/routine_bloc.dart @@ -13,7 +13,7 @@ part 'routine_event.dart'; part 'routine_state.dart'; const spaceId = '25c96044-fadf-44bb-93c7-3c079e527ce6'; -const communityId = '25c96044-fadf-44bb-93c7-3c079e527ce6'; +const communityId = 'aff21a57-2f91-4e5c-b99b-0182c3ab65a9'; class RoutineBloc extends Bloc { RoutineBloc() : super(const RoutineState()) { diff --git a/lib/pages/routiens/models/routine_details_model.dart b/lib/pages/routiens/models/routine_details_model.dart new file mode 100644 index 00000000..8ad48c58 --- /dev/null +++ b/lib/pages/routiens/models/routine_details_model.dart @@ -0,0 +1,262 @@ +import 'dart:convert'; + +import 'package:syncrow_web/pages/routiens/models/create_scene_and_autoamtion/create_automation_model.dart'; +import 'package:syncrow_web/pages/routiens/models/create_scene_and_autoamtion/create_scene_model.dart'; + +class RoutineDetailsModel { + final String spaceUuid; + final String name; + final String decisionExpr; + final List actions; + final String? iconId; + final bool? showInDevice; + final EffectiveTime? effectiveTime; + final List? conditions; + final String? type; + + RoutineDetailsModel({ + required this.spaceUuid, + required this.name, + required this.decisionExpr, + required this.actions, + this.iconId, + this.showInDevice, + this.effectiveTime, + this.conditions, + this.type, + }); + + // Convert to CreateSceneModel + CreateSceneModel toCreateSceneModel() { + return CreateSceneModel( + spaceUuid: spaceUuid, + iconId: iconId ?? '', + showInDevice: showInDevice ?? false, + sceneName: name, + decisionExpr: decisionExpr, + actions: actions.map((a) => a.toCreateSceneAction()).toList(), + ); + } + + // Convert to CreateAutomationModel + CreateAutomationModel toCreateAutomationModel() { + return CreateAutomationModel( + spaceUuid: spaceUuid, + automationName: name, + decisionExpr: decisionExpr, + effectiveTime: + effectiveTime ?? EffectiveTime(start: '', end: '', loops: ''), + conditions: conditions?.map((c) => c.toCondition()).toList() ?? [], + actions: actions.map((a) => a.toAutomationAction()).toList(), + ); + } + + Map toMap() { + return { + 'spaceUuid': spaceUuid, + 'name': name, + 'decisionExpr': decisionExpr, + 'actions': actions.map((x) => x.toMap()).toList(), + if (iconId != null) 'iconId': iconId, + if (showInDevice != null) 'showInDevice': showInDevice, + if (effectiveTime != null) 'effectiveTime': effectiveTime!.toMap(), + if (conditions != null) + 'conditions': conditions!.map((x) => x.toMap()).toList(), + if (type != null) 'type': type, + }; + } + + factory RoutineDetailsModel.fromMap(Map map) { + return RoutineDetailsModel( + spaceUuid: map['spaceUuid'] ?? '', + name: map['name'] ?? '', + decisionExpr: map['decisionExpr'] ?? '', + actions: List.from( + map['actions']?.map((x) => RoutineAction.fromMap(x)) ?? [], + ), + iconId: map['iconId'], + showInDevice: map['showInDevice'], + effectiveTime: map['effectiveTime'] != null + ? EffectiveTime.fromMap(map['effectiveTime']) + : null, + conditions: map['conditions'] != null + ? List.from( + map['conditions'].map((x) => RoutineCondition.fromMap(x))) + : null, + type: map['type'], + ); + } + + String toJson() => json.encode(toMap()); + + factory RoutineDetailsModel.fromJson(String source) => + RoutineDetailsModel.fromMap(json.decode(source)); +} + +class RoutineAction { + final String entityId; + final String actionExecutor; + final RoutineExecutorProperty? executorProperty; + + RoutineAction({ + required this.entityId, + required this.actionExecutor, + this.executorProperty, + }); + + CreateSceneAction toCreateSceneAction() { + return CreateSceneAction( + entityId: entityId, + actionExecutor: actionExecutor, + executorProperty: executorProperty?.toCreateSceneExecutorProperty(), + ); + } + + AutomationAction toAutomationAction() { + return AutomationAction( + entityId: entityId, + actionExecutor: actionExecutor, + executorProperty: executorProperty?.toExecutorProperty(), + ); + } + + Map toMap() { + return { + 'entityId': entityId, + 'actionExecutor': actionExecutor, + if (executorProperty != null) + 'executorProperty': executorProperty!.toMap(), + }; + } + + factory RoutineAction.fromMap(Map map) { + return RoutineAction( + entityId: map['entityId'] ?? '', + actionExecutor: map['actionExecutor'] ?? '', + executorProperty: map['executorProperty'] != null + ? RoutineExecutorProperty.fromMap(map['executorProperty']) + : null, + ); + } +} + +class RoutineExecutorProperty { + final String? functionCode; + final dynamic functionValue; + final int? delaySeconds; + + RoutineExecutorProperty({ + this.functionCode, + this.functionValue, + this.delaySeconds, + }); + + CreateSceneExecutorProperty toCreateSceneExecutorProperty() { + return CreateSceneExecutorProperty( + functionCode: functionCode ?? '', + functionValue: functionValue, + delaySeconds: delaySeconds ?? 0, + ); + } + + ExecutorProperty toExecutorProperty() { + return ExecutorProperty( + functionCode: functionCode, + functionValue: functionValue, + delaySeconds: delaySeconds, + ); + } + + Map toMap() { + return { + if (functionCode != null) 'functionCode': functionCode, + if (functionValue != null) 'functionValue': functionValue, + if (delaySeconds != null) 'delaySeconds': delaySeconds, + }; + } + + factory RoutineExecutorProperty.fromMap(Map map) { + return RoutineExecutorProperty( + functionCode: map['functionCode'], + functionValue: map['functionValue'], + delaySeconds: map['delaySeconds']?.toInt(), + ); + } +} + +class RoutineCondition { + final int code; + final String entityId; + final String entityType; + final RoutineConditionExpr expr; + + RoutineCondition({ + required this.code, + required this.entityId, + required this.entityType, + required this.expr, + }); + + Condition toCondition() { + return Condition( + code: code, + entityId: entityId, + entityType: entityType, + expr: expr.toConditionExpr(), + ); + } + + Map toMap() { + return { + 'code': code, + 'entityId': entityId, + 'entityType': entityType, + 'expr': expr.toMap(), + }; + } + + factory RoutineCondition.fromMap(Map map) { + return RoutineCondition( + code: map['code']?.toInt() ?? 0, + entityId: map['entityId'] ?? '', + entityType: map['entityType'] ?? '', + expr: RoutineConditionExpr.fromMap(map['expr']), + ); + } +} + +class RoutineConditionExpr { + final String statusCode; + final String comparator; + final dynamic statusValue; + + RoutineConditionExpr({ + required this.statusCode, + required this.comparator, + required this.statusValue, + }); + + ConditionExpr toConditionExpr() { + return ConditionExpr( + statusCode: statusCode, + comparator: comparator, + statusValue: statusValue, + ); + } + + Map toMap() { + return { + 'statusCode': statusCode, + 'comparator': comparator, + 'statusValue': statusValue, + }; + } + + factory RoutineConditionExpr.fromMap(Map map) { + return RoutineConditionExpr( + statusCode: map['statusCode'] ?? '', + comparator: map['comparator'] ?? '', + statusValue: map['statusValue'], + ); + } +} diff --git a/lib/pages/routiens/models/routine_model.dart b/lib/pages/routiens/models/routine_model.dart index 3ee7bd03..fe22a38c 100644 --- a/lib/pages/routiens/models/routine_model.dart +++ b/lib/pages/routiens/models/routine_model.dart @@ -1,7 +1,10 @@ +import 'dart:convert'; +import 'dart:typed_data'; import 'package:syncrow_web/utils/constants/assets.dart'; class ScenesModel { final String id; + final String? sceneTuyaId; final String name; final String status; final String type; @@ -9,26 +12,36 @@ class ScenesModel { ScenesModel({ required this.id, + this.sceneTuyaId, required this.name, required this.status, required this.type, this.icon, }); + factory ScenesModel.fromRawJson(String str) => + ScenesModel.fromJson(json.decode(str)); + + String toRawJson() => json.encode(toJson()); + + Uint8List get iconInBytes => base64Decode(icon ?? ''); + factory ScenesModel.fromJson(Map json, - {bool? isAutomation}) => - ScenesModel( - id: json["id"], - name: json["name"] ?? '', - status: json["status"] ?? '', - type: json["type"] ?? '', - icon: isAutomation == true - ? Assets.automation - : (json["icon"] as String?), - ); + {bool? isAutomation}) { + return ScenesModel( + id: json["id"] ?? json["uuid"] ?? '', + sceneTuyaId: json["sceneTuyaId"] as String?, + name: json["name"] ?? '', + status: json["status"] ?? '', + type: json["type"] ?? '', + icon: + isAutomation == true ? Assets.automation : (json["icon"] as String?), + ); + } Map toJson() => { "id": id, + "sceneTuyaId": sceneTuyaId ?? '', "name": name, "status": status, "type": type, diff --git a/lib/pages/routiens/view/routines_view.dart b/lib/pages/routiens/view/routines_view.dart index f2dac85f..be5a5a3a 100644 --- a/lib/pages/routiens/view/routines_view.dart +++ b/lib/pages/routiens/view/routines_view.dart @@ -47,7 +47,7 @@ class RoutinesView extends StatelessWidget { textString: '', ), const SizedBox( - height: 30, + height: 15, ), const Expanded(child: FetchRoutineScenesAutomation()), ], diff --git a/lib/pages/routiens/widgets/main_routine_view/fetch_routine_scenes_automation.dart b/lib/pages/routiens/widgets/main_routine_view/fetch_routine_scenes_automation.dart index 81dfa13b..031b8f63 100644 --- a/lib/pages/routiens/widgets/main_routine_view/fetch_routine_scenes_automation.dart +++ b/lib/pages/routiens/widgets/main_routine_view/fetch_routine_scenes_automation.dart @@ -5,6 +5,7 @@ import 'package:syncrow_web/pages/routiens/widgets/main_routine_view/routine_vie import 'package:syncrow_web/utils/color_manager.dart'; import 'package:syncrow_web/utils/constants/assets.dart'; import 'package:syncrow_web/utils/extension/build_context_x.dart'; +import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart'; class FetchRoutineScenesAutomation extends StatefulWidget { const FetchRoutineScenesAutomation({super.key}); @@ -14,7 +15,8 @@ class FetchRoutineScenesAutomation extends StatefulWidget { _FetchRoutineScenesState(); } -class _FetchRoutineScenesState extends State { +class _FetchRoutineScenesState extends State + with HelperResponsiveLayout { @override void initState() { super.initState(); @@ -27,83 +29,94 @@ class _FetchRoutineScenesState extends State { Widget build(BuildContext context) { return BlocBuilder( builder: (context, state) { - return SizedBox( - height: 500, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (state.isLoading) - const Center( - child: CircularProgressIndicator(), - ), - Text( - "Scenes (Tab to Run)", - style: Theme.of(context).textTheme.titleLarge?.copyWith( - color: ColorsManager.grayColor, - fontWeight: FontWeight.bold, - ), - ), - const SizedBox(height: 10), - if (state.scenes.isEmpty) + return SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.symmetric(vertical: 16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + if (state.isLoading) + const Center( + child: CircularProgressIndicator(), + ), Text( - "No scenes found", - style: context.textTheme.bodyMedium?.copyWith( - color: ColorsManager.grayColor, - ), + "Scenes (Tab to Run)", + style: Theme.of(context).textTheme.titleLarge?.copyWith( + color: ColorsManager.grayColor, + fontWeight: FontWeight.bold, + ), ), - if (state.scenes.isNotEmpty) - SizedBox( - height: 200, - child: ListView.builder( - shrinkWrap: true, - scrollDirection: Axis.horizontal, - itemCount: state.scenes.length, - itemBuilder: (context, index) { - return RoutineViewCard( - onTap: () {}, - textString: state.scenes[index].name, - icon: state.scenes[index].icon ?? Assets.logoHorizontal, - ); - }, - ), - ), - const SizedBox(height: 30), - Text( - "Automations", - style: Theme.of(context).textTheme.titleLarge?.copyWith( + const SizedBox(height: 10), + if (state.scenes.isEmpty) + Text( + "No scenes found", + style: context.textTheme.bodyMedium?.copyWith( color: ColorsManager.grayColor, - fontWeight: FontWeight.bold, ), - ), - const SizedBox(height: 10), - if (state.automations.isEmpty) - Text( - "No automations found", - style: context.textTheme.bodyMedium?.copyWith( - color: ColorsManager.grayColor, ), + if (state.scenes.isNotEmpty) + ConstrainedBox( + constraints: BoxConstraints( + maxHeight: isSmallScreenSize(context) ? 160 : 170, + ), + child: ListView.builder( + scrollDirection: Axis.horizontal, + itemCount: state.scenes.length, + itemBuilder: (context, index) => Padding( + padding: EdgeInsets.only( + right: isSmallScreenSize(context) ? 4.0 : 8.0, + ), + child: RoutineViewCard( + onTap: () {}, + textString: state.scenes[index].name, + icon: + state.scenes[index].icon ?? Assets.logoHorizontal, + isFromScenes: true, + iconInBytes: state.scenes[index].iconInBytes, + ), + ), + ), + ), + const SizedBox(height: 15), + Text( + "Automations", + style: Theme.of(context).textTheme.titleLarge?.copyWith( + color: ColorsManager.grayColor, + fontWeight: FontWeight.bold, + ), ), - if (state.automations.isNotEmpty) - SizedBox( - height: 200, - child: ListView.builder( - shrinkWrap: true, - scrollDirection: Axis.horizontal, - itemCount: state.automations.length, - itemBuilder: (context, index) { - return Padding( - padding: const EdgeInsets.only(right: 8.0), + const SizedBox(height: 10), + if (state.automations.isEmpty) + Text( + "No automations found", + style: context.textTheme.bodyMedium?.copyWith( + color: ColorsManager.grayColor, + ), + ), + if (state.automations.isNotEmpty) + ConstrainedBox( + constraints: BoxConstraints( + maxHeight: isSmallScreenSize(context) ? 160 : 170, + ), + child: ListView.builder( + scrollDirection: Axis.horizontal, + itemCount: state.automations.length, + itemBuilder: (context, index) => Padding( + padding: EdgeInsets.only( + right: isSmallScreenSize(context) ? 4.0 : 8.0, + ), child: RoutineViewCard( onTap: () {}, textString: state.automations[index].name, icon: state.automations[index].icon ?? Assets.automation, ), - ); - }, + ), + ), ), - ), - ], + ], + ), ), ); }, diff --git a/lib/pages/routiens/widgets/main_routine_view/routine_view_card.dart b/lib/pages/routiens/widgets/main_routine_view/routine_view_card.dart index 9d8b2d19..7e446507 100644 --- a/lib/pages/routiens/widgets/main_routine_view/routine_view_card.dart +++ b/lib/pages/routiens/widgets/main_routine_view/routine_view_card.dart @@ -1,84 +1,124 @@ import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:syncrow_web/utils/color_manager.dart'; +import 'package:syncrow_web/utils/constants/assets.dart'; import 'package:syncrow_web/utils/extension/build_context_x.dart'; +import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart'; -class RoutineViewCard extends StatelessWidget { +class RoutineViewCard extends StatelessWidget with HelperResponsiveLayout { const RoutineViewCard({ super.key, required this.onTap, required this.icon, required this.textString, + this.isFromScenes, + this.iconInBytes, }); final Function() onTap; final dynamic icon; final String textString; + final bool? isFromScenes; + final Uint8List? iconInBytes; @override Widget build(BuildContext context) { - return SizedBox( - height: 200, - width: 150, - child: GestureDetector( - onTap: () { - onTap(); - }, - child: Card( - elevation: 3, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), - ), - color: ColorsManager.whiteColors, - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Center( - child: Container( - decoration: BoxDecoration( - color: ColorsManager.graysColor, - borderRadius: BorderRadius.circular(120), - border: Border.all( - color: ColorsManager.greyColor, - width: 2.0, + final double cardWidth = isSmallScreenSize(context) + ? 120 + : isMediumScreenSize(context) + ? 135 + : 150; + + final double cardHeight = isSmallScreenSize(context) ? 160 : 170; + + final double iconSize = isSmallScreenSize(context) + ? 50 + : isMediumScreenSize(context) + ? 60 + : 70; + + return ConstrainedBox( + constraints: BoxConstraints( + maxWidth: cardWidth, + maxHeight: cardHeight, + ), + child: Card( + elevation: 3, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + color: ColorsManager.whiteColors, + child: InkWell( + onTap: onTap, + borderRadius: BorderRadius.circular(10), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Center( + child: Container( + decoration: BoxDecoration( + color: ColorsManager.graysColor, + borderRadius: BorderRadius.circular(120), + border: Border.all( + color: ColorsManager.greyColor, + width: 2.0, + ), + ), + height: iconSize, + width: iconSize, + child: (isFromScenes ?? false) + ? (iconInBytes != null && + iconInBytes?.isNotEmpty == true) + ? Image.memory( + iconInBytes!, + height: iconSize, + width: iconSize, + fit: BoxFit.contain, + errorBuilder: (context, error, stackTrace) => + Image.asset( + Assets.logo, + height: iconSize, + width: iconSize, + fit: BoxFit.contain, + ), + ) + : Image.asset( + Assets.logo, + height: iconSize, + width: iconSize, + fit: BoxFit.contain, + ) + : (icon is String && icon.endsWith('.svg')) + ? SvgPicture.asset( + icon, + fit: BoxFit.contain, + ) + : Icon( + icon, + color: ColorsManager.dialogBlueTitle, + size: isSmallScreenSize(context) ? 30 : 40, + ), + ), + ), + const SizedBox(height: 8), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 3), + child: Text( + textString, + textAlign: TextAlign.center, + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: context.textTheme.bodySmall?.copyWith( + color: ColorsManager.blackColor, + fontSize: isSmallScreenSize(context) ? 10 : 12, ), ), - height: 70, - width: 70, - child: (icon is String) - ? icon.endsWith('.svg') - ? SvgPicture.asset( - icon, - fit: BoxFit.contain, - ) - : Image.asset( - icon, - fit: BoxFit.contain, - ) - : Icon( - icon, - color: ColorsManager.dialogBlueTitle, - size: 40, - ), ), - ), - const SizedBox(height: 8), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 3), - child: Text( - textString, - textAlign: TextAlign.center, - overflow: TextOverflow.ellipsis, - maxLines: 2, - style: context.textTheme.bodySmall?.copyWith( - color: ColorsManager.blackColor, - fontSize: 12, - ), - ), - ), - ], + ], + ), ), ), ), diff --git a/lib/services/routines_api.dart b/lib/services/routines_api.dart index 048b6d35..1483b8ec 100644 --- a/lib/services/routines_api.dart +++ b/lib/services/routines_api.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:syncrow_web/pages/routiens/models/create_scene_and_autoamtion/create_automation_model.dart'; import 'package:syncrow_web/pages/routiens/models/create_scene_and_autoamtion/create_scene_model.dart'; import 'package:syncrow_web/pages/routiens/models/icon_model.dart'; +import 'package:syncrow_web/pages/routiens/models/routine_details_model.dart'; import 'package:syncrow_web/pages/routiens/models/routine_model.dart'; import 'package:syncrow_web/services/api/http_service.dart'; import 'package:syncrow_web/utils/constants/api_const.dart'; @@ -67,9 +68,9 @@ class SceneApi { return response; } - //get scene by unit id + //get scenes by community id and space id - static Future> getScenesByUnitId( + static Future> getScenesByUnitId( String unitId, String communityId, {showInDevice = false}) async { try { @@ -95,25 +96,6 @@ class SceneApi { } } - // static Future> getScenesByUnitId(String unitId) async { - // try { - // final response = await _httpService.get( - // path: ApiEndpoints.getSpaceScenes.replaceAll('{unitUuid}', unitId), - // showServerMessage: false, - // expectedResponseModel: (json) { - // List scenes = []; - // for (var scene in json) { - // scenes.add(ScenesModel.fromJson(scene)); - // } - // return scenes; - // }, - // ); - // return response; - // } catch (e) { - // rethrow; - // } - // } - //getAutomation static Future> getAutomationByUnitId(String unitId) async { @@ -148,21 +130,21 @@ class SceneApi { // } // } -// //automation details -// static Future getAutomationDetails( -// String automationId) async { -// try { -// final response = await _httpService.get( -// path: ApiEndpoints.getAutomationDetails -// .replaceAll('{automationId}', automationId), -// showServerMessage: false, -// expectedResponseModel: (json) => SceneDetailsModel.fromJson(json), -// ); -// return response; -// } catch (e) { -// rethrow; -// } -// } +//automation details + static Future getAutomationDetails( + String automationId) async { + try { + final response = await _httpService.get( + path: ApiEndpoints.getAutomationDetails + .replaceAll('{automationId}', automationId), + showServerMessage: false, + expectedResponseModel: (json) => RoutineDetailsModel.fromJson(json), + ); + return response; + } catch (e) { + rethrow; + } + } // // //updateAutomationStatus // static Future updateAutomationStatus(String automationId, @@ -180,20 +162,19 @@ class SceneApi { // } // } - // //getScene - // - // static Future getSceneDetails(String sceneId) async { - // try { - // final response = await _httpService.get( - // path: ApiEndpoints.getScene.replaceAll('{sceneId}', sceneId), - // showServerMessage: false, - // expectedResponseModel: (json) => SceneDetailsModel.fromJson(json), - // ); - // return response; - // } catch (e) { - // rethrow; - // } - // } + //getScene + static Future getSceneDetails(String sceneId) async { + try { + final response = await _httpService.get( + path: ApiEndpoints.getScene.replaceAll('{sceneId}', sceneId), + showServerMessage: false, + expectedResponseModel: (json) => RoutineDetailsModel.fromJson(json), + ); + return response; + } catch (e) { + rethrow; + } + } // // //update Scene // static updateScene(CreateSceneModel createSceneModel, String sceneId) async { diff --git a/lib/utils/constants/api_const.dart b/lib/utils/constants/api_const.dart index 1cb3be32..26af5793 100644 --- a/lib/utils/constants/api_const.dart +++ b/lib/utils/constants/api_const.dart @@ -46,7 +46,6 @@ abstract class ApiEndpoints { '/schedule/{deviceUuid}/{scheduleUuid}'; static const String updateScheduleByDeviceId = '/schedule/enable/{deviceUuid}'; - static const String factoryReset = '/device/factory/reset/{deviceUuid}'; static const String powerClamp = '/device/{powerClampUuid}/power-clamp/status'; @@ -57,4 +56,7 @@ abstract class ApiEndpoints { static const String createAutomation = '/automation'; static const String getUnitScenes = '/communities/{communityUuid}/spaces/{spaceUuid}/scenes'; + static const String getAutomationDetails = + '/automation/details/{automationId}'; + static const String getScene = '/scene/tap-to-run/{sceneId}'; }