TemperatureControlTemplate


public final class TemperatureControlTemplate
extends ControlTemplate

java.lang.Object
   ↳ 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

int FLAG_MODE_COOL

Flag to indicate that the device supports cool mode.

int FLAG_MODE_ECO

Flag to indicate that the device supports eco mode.

int FLAG_MODE_HEAT

Flag to indicate that the device supports heat mode.

int FLAG_MODE_HEAT_COOL

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

int FLAG_MODE_OFF

Flag to indicate that the device supports off mode.

int MODE_COOL

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

int MODE_ECO

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

int MODE_HEAT

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

int MODE_HEAT_COOL

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

int MODE_OFF

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

int MODE_UNKNOWN

Use when the current or active mode of the device is not known
Value is MODE_UNKNOWN, MODE_OFF, MODE_HEAT, MODE_COOL, MODE_HEAT_COOL, or MODE_ECO

Inherited constants

Public constructors

TemperatureControlTemplate(String templateId, ControlTemplate controlTemplate, int currentMode, int currentActiveMode, int modesFlag)

Construct a new TemperatureControlTemplate.

Public methods

int getCurrentActiveMode()
int getCurrentMode()
int getModes()
ControlTemplate getTemplate()
int getTemplateType()

The template type associated with this class.

Inherited methods

Constants

FLAG_MODE_COOL

Added in API level 30
public static final int FLAG_MODE_COOL

Flag to indicate that the device supports cool mode.

Constant Value: 8 (0x00000008)

FLAG_MODE_ECO

Added in API level 30
public static final int FLAG_MODE_ECO

Flag to indicate that the device supports eco mode.

Constant Value: 32 (0x00000020)

FLAG_MODE_HEAT

Added in API level 30
public static final int FLAG_MODE_HEAT

Flag to indicate that the device supports heat mode.

Constant Value: 4 (0x00000004)

FLAG_MODE_HEAT_COOL

Added in API level 30
public static final int FLAG_MODE_HEAT_COOL

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

Constant Value: 16 (0x00000010)

FLAG_MODE_OFF

Added in API level 30
public static final int FLAG_MODE_OFF

Flag to indicate that the device supports off mode.

Constant Value: 2 (0x00000002)

MODE_COOL

Added in API level 30
public static final int MODE_COOL

Indicates that the current or active mode of the device is set to cool.
Value is MODE_UNKNOWN, MODE_OFF, MODE_HEAT, MODE_COOL, MODE_HEAT_COOL, or MODE_ECO

Constant Value: 3 (0x00000003)

MODE_ECO

Added in API level 30
public static final int MODE_ECO

Indicates that the current or active mode of the device is set to eco.
Value is MODE_UNKNOWN, MODE_OFF, MODE_HEAT, MODE_COOL, MODE_HEAT_COOL, or MODE_ECO

Constant Value: 5 (0x00000005)

MODE_HEAT

Added in API level 30
public static final int MODE_HEAT

Indicates that the current or active mode of the device is set to heat.
Value is MODE_UNKNOWN, MODE_OFF, MODE_HEAT, MODE_COOL, MODE_HEAT_COOL, or MODE_ECO

Constant Value: 2 (0x00000002)

MODE_HEAT_COOL

Added in API level 30
public static final int MODE_HEAT_COOL

Indicates that the current or active mode of the device is set to heat-cool.
Value is MODE_UNKNOWN, MODE_OFF, MODE_HEAT, MODE_COOL, MODE_HEAT_COOL, or MODE_ECO

Constant Value: 4 (0x00000004)

MODE_OFF

Added in API level 30
public static final int MODE_OFF

Indicates that the current or active mode of the device is off.
Value is MODE_UNKNOWN, MODE_OFF, MODE_HEAT, MODE_COOL, MODE_HEAT_COOL, or MODE_ECO

Constant Value: 1 (0x00000001)

MODE_UNKNOWN

Added in API level 30
public static final int MODE_UNKNOWN

Use when the current or active mode of the device is not known
Value is MODE_UNKNOWN, MODE_OFF, MODE_HEAT, MODE_COOL, MODE_HEAT_COOL, or MODE_ECO

Constant Value: 0 (0x00000000)

Public constructors

TemperatureControlTemplate

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

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 MODE_UNKNOWN, MODE_OFF, MODE_HEAT, MODE_COOL, MODE_HEAT_COOL, or MODE_ECO

currentActiveMode int: the current active mode for the Control Value is MODE_UNKNOWN, MODE_OFF, MODE_HEAT, MODE_COOL, MODE_HEAT_COOL, or MODE_ECO

modesFlag int: a flag representing the available modes for the Control Value is either 0 or a combination of FLAG_MODE_OFF, FLAG_MODE_HEAT, FLAG_MODE_COOL, FLAG_MODE_HEAT_COOL, and FLAG_MODE_ECO

Throws
IllegalArgumentException if the parameters passed do not make a valid template.

Public methods

getCurrentActiveMode

Added in API level 30
public int getCurrentActiveMode ()

Returns
int

getCurrentMode

Added in API level 30
public int getCurrentMode ()

Returns
int

getModes

Added in API level 30
public int getModes ()

Returns
int

getTemplate

Added in API level 30
public ControlTemplate getTemplate ()

Returns
ControlTemplate This value cannot be null.

getTemplateType

Added in API level 30
public int getTemplateType ()

The template type associated with this class.

Returns
int ControlTemplate.TYPE_TEMPERATURE