CarClimate


@RequiresCarApi(value = 5)
@MainThread
@ExperimentalCarApi
public interface CarClimate


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

Summary

Public methods

abstract void
fetchClimateProfile(
    @NonNull Executor executor,
    @NonNull ClimateProfileRequest request,
    @NonNull CarClimateProfileCallback callback
)

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

abstract void

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

abstract void
<E> setClimateState(
    @NonNull Executor executor,
    @NonNull ClimateStateRequest<E> request,
    @NonNull CarSetOperationStatusCallback callback
)

Sets values for the car climate system.

abstract void

Unregisters the ongoing listener for receiving car climate state events.

Public methods

fetchClimateProfile

Added in 1.3.0
abstract void fetchClimateProfile(
    @NonNull Executor executor,
    @NonNull ClimateProfileRequest request,
    @NonNull CarClimateProfileCallback callback
)

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

Parameters
@NonNull Executor executor

the executor which will be used for invoking the listener

@NonNull ClimateProfileRequest request

the ClimateProfileRequest indicates profile features which the caller is interested in

@NonNull CarClimateProfileCallback callback

the CarClimateProfileCallback that will be invoked when the data is available

registerClimateStateCallback

Added in 1.3.0
abstract void registerClimateStateCallback(
    @NonNull Executor executor,
    @NonNull RegisterClimateStateRequest request,
    @NonNull CarClimateStateCallback callback
)

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
@NonNull Executor executor

the executor which will be used for invoking the listener

@NonNull RegisterClimateStateRequest request

the RegisterClimateStateRequest indicates climate features which the caller is interested in

@NonNull CarClimateStateCallback callback

the CarClimateStateCallback that will be invoked when the car climate is changed

setClimateState

Added in 1.3.0
abstract void <E> setClimateState(
    @NonNull Executor executor,
    @NonNull ClimateStateRequest<E> request,
    @NonNull CarSetOperationStatusCallback callback
)

Sets values for the car climate system.

Parameters
<E>

the data type for ClimateStateRequest

@NonNull Executor executor

the executor which will be used for invoking the listener

@NonNull ClimateStateRequest<E> request

the ClimateStateRequest indicates climate features which the caller is setting value for

@NonNull CarSetOperationStatusCallback callback

the CarSetOperationStatusCallback that will be invoked when the set operation succeeded or failed

unregisterClimateStateCallback

Added in 1.3.0
abstract void unregisterClimateStateCallback(
    @NonNull CarClimateStateCallback callback
)

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
@NonNull CarClimateStateCallback callback

the callback to unregister