jsgoecke / tesla

Provides a wrapper around the API to easily query and command a Telsa car. As of now this has been used with a Model S, a Model X, and a Model 3.
MIT License
325 stars 73 forks source link

ClimateState is_front_defroster_on is an integer value. #19

Closed mgb closed 5 years ago

mgb commented 7 years ago

Making a climate state call to my Model X Tesla running version 2.46.16 has the is_front_defroster_on value set to the integer 3, which breaks when unmarshalling into a bool. It appears that other APIs also think it might be an integer value too (http://docs.timdorr.apiary.io/#reference/vehicles/state-and-settings/climate-settings).

Adding in some new fields that are missing as well: left_temp_direction, right_temp_direction, is_climate_on, min_avail_temp, max_avail_temp.

Raw response from Tesla calling for climate for my vehicle: {"response":{"inside_temp":11.7,"outside_temp":9.5,"driver_temp_setting":15.0,"passenger_temp_setting":15.0,"left_temp_direction":17,"right_temp_direction":17,"is_auto_conditioning_on":false,"is_front_defroster_on":3,"is_rear_defroster_on":false,"fan_status":0,"is_climate_on":false,"min_avail_temp":15.0,"max_avail_temp":28.0,"seat_heater_left":0,"seat_heater_right":2,"seat_heater_rear_left":0,"seat_heater_rear_right":0,"seat_heater_rear_center":0,"seat_heater_rear_right_back":0,"seat_heater_rear_left_back":0,"smart_preconditioning":false}}

casperbakker commented 7 years ago

I found this same issue. is_front_defroster_on is an integer, is_rear_defroster_on is a boolean at this moment in the Tesla API.