mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-11-27 10:14:54 +00:00
Implemented room device interface
(AC only)
This commit is contained in:
@ -1,10 +1,15 @@
|
||||
import 'package:syncrow_app/generated/assets.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/constants.dart';
|
||||
|
||||
abstract class DeviceModel {
|
||||
final String? id;
|
||||
final String? name;
|
||||
final String? type;
|
||||
final DeviceType? type;
|
||||
bool? status;
|
||||
final String? image;
|
||||
final double? timer;
|
||||
|
||||
late final String icon;
|
||||
bool isSelected = false;
|
||||
|
||||
DeviceModel({
|
||||
@ -14,5 +19,25 @@ abstract class DeviceModel {
|
||||
required this.status,
|
||||
required this.image,
|
||||
required this.timer,
|
||||
});
|
||||
}) {
|
||||
switch (type) {
|
||||
case DeviceType.AC:
|
||||
icon = Assets.iconsAC;
|
||||
break;
|
||||
case DeviceType.Lights:
|
||||
icon = Assets.iconsLight;
|
||||
break;
|
||||
case DeviceType.Door:
|
||||
icon = Assets.iconsDoorLock;
|
||||
break;
|
||||
case DeviceType.Curtain:
|
||||
icon = Assets.iconsCurtain;
|
||||
break;
|
||||
case DeviceType.Gateway:
|
||||
icon = Assets.iconsGateway;
|
||||
break;
|
||||
default:
|
||||
icon = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user