mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-25 02:57:55 +00:00
4scene
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
class FourSceneSwitchModel {
|
||||
final String switchName;
|
||||
final DateTime createdAt;
|
||||
final DateTime updatedAt;
|
||||
final String deviceUuid;
|
||||
final Scene scene;
|
||||
|
||||
FourSceneSwitchModel({
|
||||
required this.switchName,
|
||||
required this.createdAt,
|
||||
required this.updatedAt,
|
||||
required this.deviceUuid,
|
||||
required this.scene,
|
||||
});
|
||||
|
||||
factory FourSceneSwitchModel.fromJson(Map<String, dynamic> json) {
|
||||
return FourSceneSwitchModel(
|
||||
switchName: json['switchName'],
|
||||
createdAt: DateTime.parse(json['createdAt']),
|
||||
updatedAt: DateTime.parse(json['updatedAt']),
|
||||
deviceUuid: json['deviceUuid'],
|
||||
scene: Scene.fromJson(json['scene']),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class Scene {
|
||||
final String uuid;
|
||||
final String sceneTuyaId;
|
||||
final String name;
|
||||
final String status;
|
||||
final String icon;
|
||||
final String iconUuid;
|
||||
final bool showInHome;
|
||||
final String type;
|
||||
final List<Action> actions;
|
||||
|
||||
Scene({
|
||||
required this.uuid,
|
||||
required this.sceneTuyaId,
|
||||
required this.name,
|
||||
required this.status,
|
||||
required this.icon,
|
||||
required this.iconUuid,
|
||||
required this.showInHome,
|
||||
required this.type,
|
||||
required this.actions,
|
||||
});
|
||||
|
||||
factory Scene.fromJson(Map<String, dynamic> json) {
|
||||
return Scene(
|
||||
uuid: json['uuid'],
|
||||
sceneTuyaId: json['sceneTuyaId'],
|
||||
name: json['name'],
|
||||
status: json['status'],
|
||||
icon: json['icon'],
|
||||
iconUuid: json['iconUuid'],
|
||||
showInHome: json['showInHome'],
|
||||
type: json['type'],
|
||||
actions: (json['actions'] as List)
|
||||
.map((action) => Action.fromJson(action))
|
||||
.toList(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class Action {
|
||||
final String actionExecutor;
|
||||
final String entityId;
|
||||
final Map<String, dynamic> executorProperty;
|
||||
|
||||
Action({
|
||||
required this.actionExecutor,
|
||||
required this.entityId,
|
||||
required this.executorProperty,
|
||||
});
|
||||
|
||||
factory Action.fromJson(Map<String, dynamic> json) {
|
||||
return Action(
|
||||
actionExecutor: json['actionExecutor'],
|
||||
entityId: json['entityId'],
|
||||
executorProperty: json['executorProperty'],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user