def convert_json_to_vehicleobj()

in pipelines/iot_analytics/iot_analytics_pipeline/parse_timestamp.py [0:0]


  def convert_json_to_vehicleobj(input_json):
    dt_object = datetime.datetime.strptime(input_json["timestamp"],
                                           "%Y-%m-%dT%H:%M:%SZ")
    event = VehicleStateEvent(
        vehicle_id=input_json["vehicle_id"],
        timestamp=dt_object,
        temperature=input_json["temperature"],
        rpm=input_json["rpm"],
        vibration=input_json["vibration"],
        fuel_level=input_json["fuel_level"],
        mileage=input_json["mileage"])
    return TimestampedValue(event, dt_object.timestamp())