mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-16 01:56:19 +00:00

Move fan speed and temperature mode logic to the DevicesCubit for better separation of concerns and improved code readability. Update widget to use BlocBuilder for state management and simplify control logic.
28 lines
516 B
Dart
28 lines
516 B
Dart
class DeviceControlModel {
|
|
String? deviceId;
|
|
String? code;
|
|
dynamic value;
|
|
|
|
DeviceControlModel({
|
|
required this.deviceId,
|
|
required this.code,
|
|
required this.value,
|
|
});
|
|
|
|
factory DeviceControlModel.fromJson(Map<String, dynamic> json) {
|
|
return DeviceControlModel(
|
|
deviceId: json['deviceId'],
|
|
code: json['code'],
|
|
value: json['value'],
|
|
);
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
return {
|
|
'deviceId': deviceId,
|
|
'code': code,
|
|
'value': value,
|
|
};
|
|
}
|
|
}
|