Controls the HVAC system
        
        
        
- Source:
Members
- 
    <static> HvacError
- 
    
    Error enumeration- Source:
 Properties:Name Type Description UNKNOWN_ERRORAn unknown error has occurred. 
- 
    <static> HvacFanDirection
- 
    
    Fan direction enumeration- Source:
 Properties:Name Type Description DEFROSTThe fan is set to defrost the front window. DEFROST_AND_FEETThe fan is directed to the front window and the feet. FACEThe fan is directed to the face. FACE_AND_FEETThe fan is directed to the face and feet. FEETThe fan is directed to the feet. 
- 
    <static> HvacSetting
- 
    
    HVAC settings enumeration- Source:
 Properties:Name Type Description FAN_SPEEDNumber The fan speed (0 to 6; 0 for off). FAN_DIRECTIONString The fan direction. Use the values from HvacFanDirection. AIR_CONDITIONINGBoolean The air conditioning (true for on). AIR_RECIRCULATIONBoolean The air recirculation (true for on). ZONE_LINKBoolean Zone Link. When on, both left and right zones are controlled by the left settings (true for on). TEMPERATURENumber The temperature (15 to 26 degrees Celsius). HEATED_SEATNumber Seat heating level (0 to 3; 0 for off). DEFROSTBoolean Window defrost (true for on). 
Methods
- 
    <static> cancelWatch(watchId)
- 
    
    
    Stop watching hvac itemsParameters:Name Type Description watchIdNumber The watch ID returned by car.hvac.watchHvac. - Source:
 Examplecar.hvac.cancelWatch(watchId);
- 
    <static> get(successCallback, errorCallback, settings, zones)
- 
    
    
    Return HVAC settings for the specified filter If successful, get() calls the successCallback with an array of setting objects. containing the setting (car.hvac.HvacSetting), the zone (car.zone) and the value (number/string/boolean). Parameters:Name Type Argument Description successCallbackFunction The callback that is called with the result. errorCallbackFunction <optional> 
 The callback that is called if there is an error. settingsArray <optional> 
 An array of car.hvac.HvacSetting values to whitelist. zonesArray <optional> 
 An array of car.zone values to whitelist. - Source:
- See:
- 
        - car.hvac.HvacSetting
- car.Zone
 
 Examples//define your callback function(s) function successCallback(hvacItems) { //iterate through all the hvac items for (var i=0; i<hvacItems.length; i++) { console.log("hvac item setting = " + hvacItems[i].setting + '\n' + //a car.hvac.HvacSetting value "hvac item zone = " + hvacItems[i].zone + '\n' + //a car.zone value "hvac item value = " + hvacItems[i].value + '\n\n'); //a mixed value type, depending on the } } function errorCallback(error) { console.log(error.code, error.msg); } //optional: define a filter. See car.hvac#HvacFilter for details //call the method car.hvac.get(successCallback, errorCallback);REST - without any filters Request: http://<car-ip>/car/hvac/get Success Response: { code: 1, data: [ { setting: 'temperature', zone: 'frontLeft', value: 20 }, { setting: 'temperature', zone: 'frontRight', value: 22 }, { setting: 'temperature', zone: 'rear', value: 22 }, { setting: 'airConditioning', zone: 'everywhere', value: true }, ... ] } Error Response: { code: -1, msg: "An error has occurred" }REST - with settings and zone filters Request: http://<car-ip>/car/hvac/get?settings=temperature,heatedSeats&zones=frontLeft,frontRight Success Response: { code: 1, data: [ { setting: 'temperature', zone: 'frontLeft', value: 20 }, { setting: 'temperature', zone: 'frontRight', value: 22 }, { setting: 'heatedSeat', zone: 'frontLeft', value: 5 }, { setting: 'heatedSeat', zone: 'frontLeft', value: 0 } ] } Error Response: { code: -1, msg: "An error has occurred" }
- 
    <static> set(setting, zone, value, successCallback, errorCallback)
- 
    
    
    Save an HVAC settingParameters:Name Type Argument Description settingString An HvacSetting value. zoneString A car.zone value. valueMixed The value to save. successCallbackFunction <optional> 
 The callback that is called with the result. errorCallbackFunction <optional> 
 The callback that is called if there is an error. - Source:
- See:
- 
        - car.hvac.HvacSetting
- car.Zone
 
 Examples//set the temperature in the entire car to 50 car.hvac.set(car.hvac.HvacSetting.TEMPERATURE, car.zone.EVERYWHERE, 50); //NOTE: this is equivalent to doing: car.hvac.set('temperature', 'everywhere', 50);REST Request: http://<car-ip>/car/hvac/set?setting=temperature&zone=frontLeft&value=25 Success Response: { code: 1, } Error Response: { code: -1, msg: "An error has occurred" }
- 
    <static> watchHvac(callback) → {Number}
- 
    
    
    Watch for hvac changesParameters:Name Type Description callbackFunction The function to be called when a change is detected. - Source:
 Returns:An ID for the added watch.- Type
- Number
 Example//define a callback function function myCallback(hvacItems) { //iterate through the changed items for (var i=0; i<hvacItems.length; i++) { console.log("hvac item setting = " + hvacItems[i].setting + '\n' + //a car.hvac.HvacSetting value "hvac item zone = " + hvacItems[i].zone + '\n' + //a car.zone value "hvac item value = " + hvacItems[i].value + '\n\n'); //a mixed value type, depending on the } } var watchId = car.hvac.watchHvac(myCallback);