76 lines
1.8 KiB
Dart
76 lines
1.8 KiB
Dart
|
|
class DhtGraphicResponse {
|
||
|
|
DataDht? data;
|
||
|
|
int? statusCode;
|
||
|
|
String? message;
|
||
|
|
|
||
|
|
DhtGraphicResponse({this.data, this.statusCode, this.message});
|
||
|
|
|
||
|
|
DhtGraphicResponse.fromJson(Map<String, dynamic> json) {
|
||
|
|
data = json['data'] != null ? DataDht.fromJson(json['data']) : null;
|
||
|
|
statusCode = json['statusCode'];
|
||
|
|
message = json['message'];
|
||
|
|
}
|
||
|
|
|
||
|
|
Map<String, dynamic> toJson() {
|
||
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||
|
|
if (this.data != null) {
|
||
|
|
data['data'] = this.data!.toJson();
|
||
|
|
}
|
||
|
|
data['statusCode'] = statusCode;
|
||
|
|
data['message'] = message;
|
||
|
|
return data;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
class DataDht {
|
||
|
|
List<Dht>? dht;
|
||
|
|
|
||
|
|
DataDht({this.dht});
|
||
|
|
|
||
|
|
DataDht.fromJson(Map<String, dynamic> json) {
|
||
|
|
if (json['dht'] != null) {
|
||
|
|
dht = <Dht>[];
|
||
|
|
json['dht'].forEach((v) {
|
||
|
|
dht!.add(Dht.fromJson(v));
|
||
|
|
});
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
Map<String, dynamic> toJson() {
|
||
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||
|
|
if (dht != null) {
|
||
|
|
data['dht'] = dht!.map((v) => v.toJson()).toList();
|
||
|
|
}
|
||
|
|
return data;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
class Dht {
|
||
|
|
int? hour;
|
||
|
|
double? vicitemperatureAvg;
|
||
|
|
double? vicihumidityAvg;
|
||
|
|
double? viciluminosityAvg;
|
||
|
|
|
||
|
|
Dht(
|
||
|
|
{this.hour,
|
||
|
|
this.vicitemperatureAvg,
|
||
|
|
this.vicihumidityAvg,
|
||
|
|
this.viciluminosityAvg});
|
||
|
|
|
||
|
|
Dht.fromJson(Map<String, dynamic> json) {
|
||
|
|
hour = json['hour'];
|
||
|
|
vicitemperatureAvg = json['vicitemperature_avg'];
|
||
|
|
vicihumidityAvg = json['vicihumidity_avg'];
|
||
|
|
viciluminosityAvg = json['viciluminosity_avg'];
|
||
|
|
}
|
||
|
|
|
||
|
|
Map<String, dynamic> toJson() {
|
||
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||
|
|
data['hour'] = hour;
|
||
|
|
data['vicitemperature_avg'] = vicitemperatureAvg;
|
||
|
|
data['vicihumidity_avg'] = vicihumidityAvg;
|
||
|
|
data['viciluminosity_avg'] = viciluminosityAvg;
|
||
|
|
return data;
|
||
|
|
}
|
||
|
|
}
|