22 lines
497 B
Dart
22 lines
497 B
Dart
class SensorData {
|
|
final double temperature;
|
|
final double humidity;
|
|
final double dewPoint;
|
|
final int timestamp;
|
|
|
|
SensorData({
|
|
required this.temperature,
|
|
required this.humidity,
|
|
required this.dewPoint,
|
|
required this.timestamp,
|
|
});
|
|
|
|
factory SensorData.fromJson(Map<String, dynamic> json) {
|
|
return SensorData(
|
|
temperature: json['temperature'],
|
|
humidity: json['humidity'],
|
|
dewPoint: json['dewPoint'],
|
|
timestamp: json['timestamp'],
|
|
);
|
|
}
|
|
} |