ClimateState.fromJson constructor

ClimateState.fromJson(
  1. Map<String, dynamic> json
)

Creates a new instance of the ClimateState class from a map.

The json argument is a Map with string keys and dynamic values. Each key corresponds to a property of the ClimateState class.

Implementation

factory ClimateState.fromJson(Map<String, dynamic> json) {
  return ClimateState(
    insideTemp: json['inside_temp'],
    outsideTemp: json['outside_temp'],
    driverTempSetting: json['driver_temp_setting'],
    passengerTempSetting: json['passenger_temp_setting'],
    leftTempDirection: json['left_temp_direction'],
    rightTempDirection: json['right_temp_direction'],
    isFrontDefrosterOn: json['is_front_defroster_on'],
    isRearDefrosterOn: json['is_rear_defroster_on'],
    fanStatus: json['fan_status'],
    isClimateOn: json['is_climate_on'],
    minAvailTemp: json['min_avail_temp'],
    maxAvailTemp: json['max_avail_temp'],
    seatHeaterLeft: json['seat_heater_left'],
    seatHeaterRight: json['seat_heater_right'],
    seatHeaterRearLeft: json['seat_heater_rear_left'],
    seatHeaterRearRight: json['seat_heater_rear_right'],
    seatHeaterRearCenter: json['seat_heater_rear_center'],
    seatHeaterRearRightBack: json['seat_heater_rear_right_back'],
    seatHeaterRearLeftBack: json['seat_heater_rear_left_back'],
    batteryHeater: json['battery_heater'],
    batteryHeaterNoPower: json['battery_heater_no_power'],
    steeringWheelHeater: json['steering_wheel_heater'],
    wiperBladeHeater: json['wiper_blade_heater'],
    sideMirrorHeaters: json['side_mirror_heaters'],
    isPreconditioning: json['is_preconditioning'],
    smartPreconditioning: json['smart_preconditioning'],
    isAutoConditioningOn: json['is_auto_conditioning_on'],
    timestamp: json['timestamp'],
  );
}