Added in API level 30

TemperatureControlTemplate


class TemperatureControlTemplate : ControlTemplate
kotlin.Any
   ↳ android.service.controls.templates.ControlTemplate
   ↳ android.service.controls.templates.TemperatureControlTemplate

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
Public constructors
TemperatureControlTemplate(templateId: String, controlTemplate: ControlTemplate, currentMode: Int, currentActiveMode: Int, modesFlag: Int)

Construct a new TemperatureControlTemplate.

Public methods
Int

Int

Int

ControlTemplate

Int

Inherited functions

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
Return
Int ControlTemplate.TYPE_TEMPERATURE