class DeviceLog { String? thingId; DateTime? from; DateTime? to; int? total; int? offset; List? sensors; DeviceLog({ this.thingId, this.from, this.to, this.total, this.offset, this.sensors, }); DeviceLog.fromJson(Map json) { thingId = json["thing_id"]; from = DateTime.parse(json["from"]); to = DateTime.parse(json["to"]); total = json["total"]; offset = json["offset"]; if (json['sensors'] != null) { sensors = []; json['sensors'].forEach((v) { sensors!.add(SensorLogs.fromJson(v)); }); } } } class SensorLogs { String? name; int? value; int? time; LogDetail? detail; SensorLogs({ this.name, this.value, this.time, this.detail, }); SensorLogs.fromJson(Map json) { name = json["n"]; value = json["v"]; time = json["t"]; detail = json["x"] != null ? LogDetail.fromJson(json["x"]) : null; } } class LogDetail { String? username; String? note; LogDetail({ this.username, this.note, }); LogDetail.fromJson(Map json) { username = json["username"]; note = json["note"]; } }