SceneAction.fromJson constructor

SceneAction.fromJson(
  1. Map<String, dynamic> dataMap
)

Creates a SceneAction object from the JSON response to a GET request.

Implementation

factory SceneAction.fromJson(Map<String, dynamic> dataMap) {
  return SceneAction(
    target: Relative.fromJson(
        Map<String, dynamic>.from(dataMap[ApiFields.target] ?? {})),
    action: SceneActionAction.fromJson(
        Map<String, dynamic>.from(dataMap[ApiFields.action] ?? {})),
  );
}