mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 22:57:21 +00:00
37 lines
817 B
Dart
37 lines
817 B
Dart
import 'package:syncrow_web/utils/constants/assets.dart';
|
|
|
|
class ScenesModel {
|
|
final String id;
|
|
final String name;
|
|
final String status;
|
|
final String type;
|
|
final String? icon;
|
|
|
|
ScenesModel({
|
|
required this.id,
|
|
required this.name,
|
|
required this.status,
|
|
required this.type,
|
|
this.icon,
|
|
});
|
|
|
|
factory ScenesModel.fromJson(Map<String, dynamic> json,
|
|
{bool? isAutomation}) =>
|
|
ScenesModel(
|
|
id: json["id"],
|
|
name: json["name"] ?? '',
|
|
status: json["status"] ?? '',
|
|
type: json["type"] ?? '',
|
|
icon: (isAutomation ?? false)
|
|
? Assets.automation
|
|
: json["icon"] as String?,
|
|
);
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
"id": id,
|
|
"name": name,
|
|
"status": status,
|
|
"type": type,
|
|
};
|
|
}
|