Added in API level 30

TemperatureControlTemplate


class TemperatureControlTemplate : ControlTemplate

A template for a temperature related Control that supports multiple modes. Both the current mode and the active mode for the control can be specified. The combination of the Control.getDeviceType and the current and active mode will determine colors and transitions for the UI element.

Summary

Constants
static Int

Flag to indicate that the device supports cool mode.

static Int

Flag to indicate that the device supports eco mode.

static Int

Flag to indicate that the device supports heat mode.

static Int

Flag to indicate that the device supports heat-cool mode.

static Int

Flag to indicate that the device supports off mode.

static Int

Indicates that the current or active mode of the device is set to cool.

static Int

Indicates that the current or active mode of the device is set to eco.

static Int

Indicates that the current or active mode of the device is set to heat.

static Int

Indicates that the current or active mode of the device is set to heat-cool.

static Int

Indicates that the current or active mode of the device is off.

static Int

Use when the current or active mode of the device is not known
Value is android.service.controls.templates.TemperatureControlTemplate#MODE_UNKNOWN, android.service.controls.templates.TemperatureControlTemplate#MODE_OFF, android.service.controls.templates.TemperatureControlTemplate#MODE_HEAT, android.service.controls.templates.TemperatureControlTemplate#MODE_COOL, android.service.controls.templates.TemperatureControlTemplate#MODE_HEAT_COOL, or android.service.controls.templates.TemperatureControlTemplate#MODE_ECO

Inherited constants
Int TYPE_ERROR

Type identifier of the template returned by getErrorTemplate().
Value is android.service.controls.templates.ControlTemplate#TYPE_ERROR, android.service.controls.templates.ControlTemplate#TYPE_NO_TEMPLATE, android.service.controls.templates.ControlTemplate#TYPE_TOGGLE, android.service.controls.templates.ControlTemplate#TYPE_RANGE, android.service.controls.templates.ControlTemplate#TYPE_THUMBNAIL, android.service.controls.templates.ControlTemplate#TYPE_TOGGLE_RANGE, android.service.controls.templates.ControlTemplate#TYPE_TEMPERATURE, or android.service.controls.templates.ControlTemplate#TYPE_STATELESS

Int TYPE_NO_TEMPLATE

Type identifier of ControlTemplate.getNoTemplateObject.
Value is android.service.controls.templates.ControlTemplate#TYPE_ERROR, android.service.controls.templates.ControlTemplate#TYPE_NO_TEMPLATE, android.service.controls.templates.ControlTemplate#TYPE_TOGGLE, android.service.controls.templates.ControlTemplate#TYPE_RANGE, android.service.controls.templates.ControlTemplate#TYPE_THUMBNAIL, android.service.controls.templates.ControlTemplate#TYPE_TOGGLE_RANGE, android.service.controls.templates.ControlTemplate#TYPE_TEMPERATURE, or android.service.controls.templates.ControlTemplate#TYPE_STATELESS

Int TYPE_RANGE

Type identifier of RangeTemplate.
Value is android.service.controls.templates.ControlTemplate#TYPE_ERROR, android.service.controls.templates.ControlTemplate#TYPE_NO_TEMPLATE, android.service.controls.templates.ControlTemplate#TYPE_TOGGLE, android.service.controls.templates.ControlTemplate#TYPE_RANGE, android.service.controls.templates.ControlTemplate#TYPE_THUMBNAIL, android.service.controls.templates.ControlTemplate#TYPE_TOGGLE_RANGE, android.service.controls.templates.ControlTemplate#TYPE_TEMPERATURE, or android.service.controls.templates.ControlTemplate#TYPE_STATELESS

Int TYPE_STATELESS

Type identifier of StatelessTemplate.
Value is android.service.controls.templates.ControlTemplate#TYPE_ERROR, android.service.controls.templates.ControlTemplate#TYPE_NO_TEMPLATE, android.service.controls.templates.ControlTemplate#TYPE_TOGGLE, android.service.controls.templates.ControlTemplate#TYPE_RANGE, android.service.controls.templates.ControlTemplate#TYPE_THUMBNAIL, android.service.controls.templates.ControlTemplate#TYPE_TOGGLE_RANGE, android.service.controls.templates.ControlTemplate#TYPE_TEMPERATURE, or android.service.controls.templates.ControlTemplate#TYPE_STATELESS

Int TYPE_TEMPERATURE

Type identifier of TemperatureControlTemplate.
Value is android.service.controls.templates.ControlTemplate#TYPE_ERROR, android.service.controls.templates.ControlTemplate#TYPE_NO_TEMPLATE, android.service.controls.templates.ControlTemplate#TYPE_TOGGLE, android.service.controls.templates.ControlTemplate#TYPE_RANGE, android.service.controls.templates.ControlTemplate#TYPE_THUMBNAIL, android.service.controls.templates.ControlTemplate#TYPE_TOGGLE_RANGE, android.service.controls.templates.ControlTemplate#TYPE_TEMPERATURE, or android.service.controls.templates.ControlTemplate#TYPE_STATELESS

Int TYPE_THUMBNAIL

Type identifier of ThumbnailTemplate.
Value is android.service.controls.templates.ControlTemplate#TYPE_ERROR, android.service.controls.templates.ControlTemplate#TYPE_NO_TEMPLATE, android.service.controls.templates.ControlTemplate#TYPE_TOGGLE, android.service.controls.templates.ControlTemplate#TYPE_RANGE, android.service.controls.templates.ControlTemplate#TYPE_THUMBNAIL, android.service.controls.templates.ControlTemplate#TYPE_TOGGLE_RANGE, android.service.controls.templates.ControlTemplate#TYPE_TEMPERATURE, or android.service.controls.templates.ControlTemplate#TYPE_STATELESS

Int TYPE_TOGGLE

Type identifier of ToggleTemplate.
Value is android.service.controls.templates.ControlTemplate#TYPE_ERROR, android.service.controls.templates.ControlTemplate#TYPE_NO_TEMPLATE, android.service.controls.templates.ControlTemplate#TYPE_TOGGLE, android.service.controls.templates.ControlTemplate#TYPE_RANGE, android.service.controls.templates.ControlTemplate#TYPE_THUMBNAIL, android.service.controls.templates.ControlTemplate#TYPE_TOGGLE_RANGE, android.service.controls.templates.ControlTemplate#TYPE_TEMPERATURE, or android.service.controls.templates.ControlTemplate#TYPE_STATELESS

Int TYPE_TOGGLE_RANGE

Type identifier of ToggleRangeTemplate.
Value is android.service.controls.templates.ControlTemplate#TYPE_ERROR, android.service.controls.templates.ControlTemplate#TYPE_NO_TEMPLATE, android.service.controls.templates.ControlTemplate#TYPE_TOGGLE, android.service.controls.templates.ControlTemplate#TYPE_RANGE, android.service.controls.templates.ControlTemplate#TYPE_THUMBNAIL, android.service.controls.templates.ControlTemplate#TYPE_TOGGLE_RANGE, android.service.controls.templates.ControlTemplate#TYPE_TEMPERATURE, or android.service.controls.templates.ControlTemplate#TYPE_STATELESS

Public constructors
TemperatureControlTemplate(templateId: String, controlTemplate: ControlTemplate, currentMode: Int, currentActiveMode: Int, modesFlag: Int)

Construct a new TemperatureControlTemplate.

Inherited functions
ControlTemplate getErrorTemplate()

ControlTemplate getNoTemplateObject()

Get a singleton ControlTemplate, which supports no direct user input. Used by Control.StatelessBuilder when there is no known state. Can also be used in Control.StatefulBuilder for conveying information to a user about the Control but direct user interaction is not desired. Since this template has no corresponding ControlAction, any user interaction will launch the Control.getAppIntent().

String getTemplateId()

Constants

FLAG_MODE_COOL

Added in API level 30
static val FLAG_MODE_COOL: Int

Flag to indicate that the device supports cool mode.

Value: 8

FLAG_MODE_ECO

Added in API level 30
static val FLAG_MODE_ECO: Int

Flag to indicate that the device supports eco mode.

Value: 32

FLAG_MODE_HEAT

Added in API level 30
static val FLAG_MODE_HEAT: Int

Flag to indicate that the device supports heat mode.

Value: 4

FLAG_MODE_HEAT_COOL

Added in API level 30
static val FLAG_MODE_HEAT_COOL: Int

Flag to indicate that the device supports heat-cool mode.

Value: 16

FLAG_MODE_OFF

Added in API level 30
static val FLAG_MODE_OFF: Int

Flag to indicate that the device supports off mode.

Value: 2

Public constructors

TemperatureControlTemplate

Added in API level 30
TemperatureControlTemplate(
    templateId: String,
    controlTemplate: ControlTemplate,
    currentMode: Int,
    currentActiveMode: Int,
    modesFlag: Int)

Construct a new TemperatureControlTemplate. The current and active mode have to be among the ones supported by the flags.

Parameters
templateId String: the identifier for this template object This value cannot be null.
controlTemplate ControlTemplate: a template to use for interaction with the user This value cannot be null.
currentMode Int: the current mode for the Control Value is android.service.controls.templates.TemperatureControlTemplate#MODE_UNKNOWN, android.service.controls.templates.TemperatureControlTemplate#MODE_OFF, android.service.controls.templates.TemperatureControlTemplate#MODE_HEAT, android.service.controls.templates.TemperatureControlTemplate#MODE_COOL, android.service.controls.templates.TemperatureControlTemplate#MODE_HEAT_COOL, or android.service.controls.templates.TemperatureControlTemplate#MODE_ECO
currentActiveMode Int: the current active mode for the Control Value is android.service.controls.templates.TemperatureControlTemplate#MODE_UNKNOWN, android.service.controls.templates.TemperatureControlTemplate#MODE_OFF, android.service.controls.templates.TemperatureControlTemplate#MODE_HEAT, android.service.controls.templates.TemperatureControlTemplate#MODE_COOL, android.service.controls.templates.TemperatureControlTemplate#MODE_HEAT_COOL, or android.service.controls.templates.TemperatureControlTemplate#MODE_ECO
modesFlag Int: a flag representing the available modes for the Control Value is either 0 or a combination of android.service.controls.templates.TemperatureControlTemplate#FLAG_MODE_OFF, android.service.controls.templates.TemperatureControlTemplate#FLAG_MODE_HEAT, android.service.controls.templates.TemperatureControlTemplate#FLAG_MODE_COOL, android.service.controls.templates.TemperatureControlTemplate#FLAG_MODE_HEAT_COOL, and android.service.controls.templates.TemperatureControlTemplate#FLAG_MODE_ECO
Exceptions
java.lang.IllegalArgumentException if the parameters passed do not make a valid template.

Public methods

getCurrentActiveMode

Added in API level 30
fun getCurrentActiveMode(): Int

getCurrentMode

Added in API level 30
fun getCurrentMode(): Int

getModes

Added in API level 30
fun getModes(): Int

getTemplate

Added in API level 30
fun getTemplate(): ControlTemplate
Return
ControlTemplate This value cannot be null.

getTemplateType

Added in API level 30
fun getTemplateType(): Int