toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final data = <String, dynamic>{};
  if (sensor != null) {
    data['sensor'] = sensor!.toJson();
  }
  data['value'] = value;
  return data;
}