# CarClimate

Artifact: [androidx.car.app:app](https://developer.android.com/jetpack/androidx/releases/car-app) [View Source](https://cs.android.com/search?q=file:androidx/car/app/hardware/climate/CarClimate.java+class:androidx.car.app.hardware.climate.CarClimate) Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.3.0)

*** ** * ** ***


```
@RequiresCarApi(value = 5)
@MainThread
interface CarClimate
```

<br />

*** ** * ** ***

Manages access to car climate system such as cabin temperatures, fan speeds and fan directions.

## Summary

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/hardware/climate/CarClimate#fetchClimateProfile(java.util.concurrent.Executor,androidx.car.app.hardware.climate.ClimateProfileRequest,androidx.car.app.hardware.climate.CarClimateProfileCallback)( executor: https://developer.android.com/reference/java/util/concurrent/Executor.html, request: https://developer.android.com/reference/kotlin/androidx/car/app/hardware/climate/ClimateProfileRequest, callback: https://developer.android.com/reference/kotlin/androidx/car/app/hardware/climate/CarClimateProfileCallback )` Fetches the climate profile information of the associated features specified in the request, for example, HVAC features like Fan Speed, Cabin Temperature, etc. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/hardware/climate/CarClimate#registerClimateStateCallback(java.util.concurrent.Executor,androidx.car.app.hardware.climate.RegisterClimateStateRequest,androidx.car.app.hardware.climate.CarClimateStateCallback)( executor: https://developer.android.com/reference/java/util/concurrent/Executor.html, request: https://developer.android.com/reference/kotlin/androidx/car/app/hardware/climate/RegisterClimateStateRequest, callback: https://developer.android.com/reference/kotlin/androidx/car/app/hardware/climate/CarClimateStateCallback )` Registers an ongoing listener to receive car climate state events from the car hardware such as when the driver side temperature is increased/decreased. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `<E> https://developer.android.com/reference/kotlin/androidx/car/app/hardware/climate/CarClimate#setClimateState(java.util.concurrent.Executor,androidx.car.app.hardware.climate.ClimateStateRequest<E>,androidx.car.app.hardware.common.CarSetOperationStatusCallback)( executor: https://developer.android.com/reference/java/util/concurrent/Executor.html, request: https://developer.android.com/reference/kotlin/androidx/car/app/hardware/climate/ClimateStateRequest<E!>, callback: https://developer.android.com/reference/kotlin/androidx/car/app/hardware/common/CarSetOperationStatusCallback )` Sets values for the car climate system. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/hardware/climate/CarClimate#unregisterClimateStateCallback(androidx.car.app.hardware.climate.CarClimateStateCallback)(callback: https://developer.android.com/reference/kotlin/androidx/car/app/hardware/climate/CarClimateStateCallback)` Unregisters the ongoing listener for receiving car climate state events. |

## Public functions

### fetchClimateProfile

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.3.0)

```
fun fetchClimateProfile(
    executor: Executor,
    request: ClimateProfileRequest,
    callback: CarClimateProfileCallback
): Unit
```

Fetches the climate profile information of the associated features specified in the request, for example, HVAC features like Fan Speed, Cabin Temperature, etc.

| Parameters |
|---|---|
| `executor: https://developer.android.com/reference/java/util/concurrent/Executor.html` | the executor which will be used for invoking the listener |
| `request: https://developer.android.com/reference/kotlin/androidx/car/app/hardware/climate/ClimateProfileRequest` | the ClimateProfileRequest indicates profile features which the caller is interested in |
| `callback: https://developer.android.com/reference/kotlin/androidx/car/app/hardware/climate/CarClimateProfileCallback` | the CarClimateProfileCallback that will be invoked when the data is available |

### registerClimateStateCallback

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.3.0)

```
fun registerClimateStateCallback(
    executor: Executor,
    request: RegisterClimateStateRequest,
    callback: CarClimateStateCallback
): Unit
```

Registers an ongoing listener to receive car climate state events from the car hardware such as when the driver side temperature is increased/decreased.

If the callback was registered previously then it won't be registered again.

| Parameters |
|---|---|
| `executor: https://developer.android.com/reference/java/util/concurrent/Executor.html` | the executor which will be used for invoking the listener |
| `request: https://developer.android.com/reference/kotlin/androidx/car/app/hardware/climate/RegisterClimateStateRequest` | the RegisterClimateStateRequest indicates climate features which the caller is interested in |
| `callback: https://developer.android.com/reference/kotlin/androidx/car/app/hardware/climate/CarClimateStateCallback` | the CarClimateStateCallback that will be invoked when the car climate is changed |

### setClimateState

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.3.0)

```
fun <E> setClimateState(
    executor: Executor,
    request: ClimateStateRequest<E!>,
    callback: CarSetOperationStatusCallback
): Unit
```

Sets values for the car climate system.

| Parameters |
|---|---|
| `<E>` | the data type for ClimateStateRequest |
| `executor: https://developer.android.com/reference/java/util/concurrent/Executor.html` | the executor which will be used for invoking the listener |
| `request: https://developer.android.com/reference/kotlin/androidx/car/app/hardware/climate/ClimateStateRequest<E!>` | the ClimateStateRequest indicates climate features which the caller is setting value for |
| `callback: https://developer.android.com/reference/kotlin/androidx/car/app/hardware/common/CarSetOperationStatusCallback` | the CarSetOperationStatusCallback that will be invoked when the set operation succeeded or failed |

### unregisterClimateStateCallback

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.3.0)

```
fun unregisterClimateStateCallback(callback: CarClimateStateCallback): Unit
```

Unregisters the ongoing listener for receiving car climate state events.

If the callback is not currently registered, then this method call has no impact.

| Parameters |
|---|---|
| `callback: https://developer.android.com/reference/kotlin/androidx/car/app/hardware/climate/CarClimateStateCallback` | the callback to unregister |