mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-16 01:56:19 +00:00
setting
This commit is contained in:
@ -1,31 +1,4 @@
|
||||
// import 'package:syncrow_app/features/devices/model/status_model.dart';
|
||||
|
||||
// class OneTouchModel {
|
||||
// bool firstSwitch;
|
||||
// int firstCountDown;
|
||||
|
||||
// OneTouchModel({
|
||||
// required this.firstSwitch,
|
||||
// required this.firstCountDown,
|
||||
// });
|
||||
|
||||
// factory OneTouchModel.fromJson(List<StatusModel> jsonList) {
|
||||
// late bool _switch;
|
||||
// late int _count;
|
||||
|
||||
// for (int i = 0; i < jsonList.length; i++) {
|
||||
// if (jsonList[i].code == 'switch_1') {
|
||||
// _switch = jsonList[i].value ?? false;
|
||||
// } else if (jsonList[i].code == 'countdown_1') {
|
||||
// _count = jsonList[i].value ?? 0;
|
||||
// }
|
||||
// }
|
||||
// return OneTouchModel(
|
||||
// firstSwitch: _switch,
|
||||
// firstCountDown: _count,
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
|
||||
import 'package:syncrow_app/features/devices/model/status_model.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/constants.dart';
|
||||
@ -34,8 +7,8 @@ class OneTouchModel {
|
||||
bool firstSwitch;
|
||||
int firstCountDown;
|
||||
status relay;
|
||||
String light_mode;
|
||||
String relay_status_1;
|
||||
lightStatus light_mode;
|
||||
status relay_status_1;
|
||||
|
||||
OneTouchModel(
|
||||
{required this.firstSwitch,
|
||||
@ -67,8 +40,10 @@ class OneTouchModel {
|
||||
return OneTouchModel(
|
||||
firstSwitch: _switch,
|
||||
firstCountDown: _count,
|
||||
light_mode: _light_mode,
|
||||
light_mode: lightStatusExtension.fromString(_light_mode) ,
|
||||
relay: StatusExtension.fromString(_relay ) ,
|
||||
relay_status_1: relay_status_1);
|
||||
relay_status_1: StatusExtension.fromString(relay_status_1 )
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user