SmartSceneWeekStartTime.fromJson constructor

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

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

Implementation

factory SmartSceneWeekStartTime.fromJson(Map<String, dynamic> dataMap) {
  Map<String, dynamic> timeMap =
      Map<String, dynamic>.from(dataMap[ApiFields.time] ?? {});

  return SmartSceneWeekStartTime(
    kind: dataMap[ApiFields.kind] ?? "",
    hour: timeMap[ApiFields.hour] ?? 0,
    minute: timeMap[ApiFields.minute] ?? 0,
    second: timeMap[ApiFields.second] ?? 0,
  );
}