import 'package:syncrow_web/pages/device_managment/all_devices/models/device_status.dart';

class CurtainModel {
  final String productUuid;
  final String productType;
  final List<Status> status;

  CurtainModel({
    required this.productUuid,
    required this.productType,
    required this.status,
  });

  factory CurtainModel.fromJson(dynamic json) {
    var statusList = json['status'] as List;
    List<Status> status = statusList.map((i) => Status.fromJson(i)).toList();

    return CurtainModel(
      productUuid: json['productUuid'],
      productType: json['productType'],
      status: status,
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'productUuid': productUuid,
      'productType': productType,
      'status': status.map((s) => s.toJson()).toList(),
    };
  }
}
