mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-15 17:47:28 +00:00
52 lines
1.1 KiB
Dart
52 lines
1.1 KiB
Dart
import 'package:syncrow_app/features/devices/model/device_model.dart';
|
|
|
|
class ACModel extends DeviceModel {
|
|
late double temperature;
|
|
|
|
late int fanSpeed;
|
|
|
|
late int tempMode;
|
|
|
|
ACModel({
|
|
required this.temperature,
|
|
required this.fanSpeed,
|
|
required this.tempMode,
|
|
required super.id,
|
|
required super.name,
|
|
required super.type,
|
|
required super.status,
|
|
required super.location,
|
|
required super.image,
|
|
required super.timer,
|
|
});
|
|
|
|
Map<String, dynamic> toJson() {
|
|
return {
|
|
'temperature': temperature,
|
|
'fanSpeed': fanSpeed,
|
|
'tempMode': tempMode,
|
|
'id': id,
|
|
'name': name,
|
|
'status': status,
|
|
'type': type,
|
|
'location': location,
|
|
'image': image,
|
|
};
|
|
}
|
|
|
|
factory ACModel.fromJson(Map<String, dynamic> json) {
|
|
return ACModel(
|
|
id: json['id'],
|
|
name: json['name'],
|
|
status: json['status'],
|
|
temperature: json['temperature'],
|
|
fanSpeed: json['fanSpeed'],
|
|
tempMode: json['tempMode'],
|
|
type: json['type'],
|
|
location: json['location'],
|
|
image: json['image'],
|
|
timer: json['timer'],
|
|
);
|
|
}
|
|
}
|