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

int TYPE_ERROR

Type identifier of the template returned by getErrorTemplate().

int TYPE_NO_TEMPLATE

Type identifier of ControlTemplate.getNoTemplateObject.

int TYPE_RANGE

Type identifier of RangeTemplate.

int TYPE_STATELESS

Type identifier of StatelessTemplate.

int TYPE_TEMPERATURE

Type identifier of TemperatureControlTemplate.

int TYPE_THUMBNAIL

Type identifier of ThumbnailTemplate.

int TYPE_TOGGLE

Type identifier of ToggleTemplate.

int TYPE_TOGGLE_RANGE

Type identifier of ToggleRangeTemplate.

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

static ControlTemplate getErrorTemplate()
static ControlTemplate getNoTemplateObject()

Get a singleton ControlTemplate, which supports no direct user input.

String getTemplateId()
abstract int getTemplateType()

The template type associated with this class.

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

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.