ThermostatCommands

interface ThermostatCommands

Known direct subclasses
Thermostat

API for the Thermostat trait.


Summary

Public functions

suspend Unit
suspend Unit
suspend Unit

Clear the weekly schedule.

suspend Unit
suspend ThermostatTrait.GetWeeklyScheduleCommand.Response

Get the weekly schedule for the device.

suspend Unit
suspend Unit
suspend Unit
suspend Unit
setWeeklySchedule(
    numberOfTransitionsForSequence: UByte,
    dayOfWeekForSequence: ThermostatTrait.ScheduleDayOfWeekBitmap,
    modeForSequence: ThermostatTrait.ScheduleModeBitmap,
    transitions: List<ThermostatTrait.WeeklyScheduleTransitionStruct>
)

Set the weekly schedule.

suspend Unit

Change the setpoint for the current thermostat mode.

suspend Unit

Public functions

cancelPresetsSchedulesEditRequest

suspend fun cancelPresetsSchedulesEditRequest(): Unit

cancelSetActivePresetRequest

suspend fun cancelSetActivePresetRequest(): Unit

clearWeeklySchedule

suspend fun clearWeeklySchedule(): Unit

Clear the weekly schedule.

commitPresetsSchedulesRequest

suspend fun commitPresetsSchedulesRequest(): Unit

getWeeklySchedule

suspend fun getWeeklySchedule(
    daysToReturn: ThermostatTrait.ScheduleDayOfWeekBitmap,
    modeToReturn: ThermostatTrait.ScheduleModeBitmap
): ThermostatTrait.GetWeeklyScheduleCommand.Response

Get the weekly schedule for the device.

Parameters
daysToReturn: ThermostatTrait.ScheduleDayOfWeekBitmap

The number of days the client would like to return the set point values for. It can be any combination of single days or the entire week.

modeToReturn: ThermostatTrait.ScheduleModeBitmap

Indicates the mode the client would like to return the set point values for. It can be any combination of modes.

Returns
ThermostatTrait.GetWeeklyScheduleCommand.Response

The weekly schedule, with the same payload as setWeeklySchedule.

setActivePresetRequest

suspend fun setActivePresetRequest(
    presetHandle: ByteArray,
    optionalArgs: ThermostatTrait.SetActivePresetRequestCommand.OptionalArgs.() -> Unit = {}
): Unit

setActiveScheduleRequest

suspend fun setActiveScheduleRequest(scheduleHandle: ByteArray): Unit

setTemperatureSetpointHoldPolicy

suspend fun setTemperatureSetpointHoldPolicy(
    temperatureSetpointHoldPolicy: ThermostatTrait.TemperatureSetpointHoldPolicyBitmap
): Unit

setWeeklySchedule

suspend fun setWeeklySchedule(
    numberOfTransitionsForSequence: UByte,
    dayOfWeekForSequence: ThermostatTrait.ScheduleDayOfWeekBitmap,
    modeForSequence: ThermostatTrait.ScheduleModeBitmap,
    transitions: List<ThermostatTrait.WeeklyScheduleTransitionStruct>
): Unit

Set the weekly schedule.

Parameters
numberOfTransitionsForSequence: UByte

The number of individual transitions to expect for this sequence of commands.

dayOfWeekForSequence: ThermostatTrait.ScheduleDayOfWeekBitmap

The day(s) of the week to which all the transitions within the payload of the command should be associated. The bitmap values conform to those defined in ScheduleDayOfWeekBitmap.

modeForSequence: ThermostatTrait.ScheduleModeBitmap

How the app decodes the coolSetpoint and heatSetpoint fields of each transition. The bitmap values confirm to those defined in ScheduleModeBitmap.

transitions: List<ThermostatTrait.WeeklyScheduleTransitionStruct>

The list of setpoint transitions used to update the specified daily schedules. Each setpoint transition is represented by a WeeklyScheduleTransitionStruct.

setpointRaiseLower

suspend fun setpointRaiseLower(
    mode: ThermostatTrait.SetpointRaiseLowerModeEnum,
    amount: Byte
): Unit

Change the setpoint for the current thermostat mode.

Parameters
mode: ThermostatTrait.SetpointRaiseLowerModeEnum

The setpoint(s) to be adjusted. Valid values are defined by SetpointRaiseLowerModeEnum.

amount: Byte

The amount (possibly negative) that should be added to the setpoint(s), in steps of 0.1°C.

startPresetsSchedulesEditRequest

suspend fun startPresetsSchedulesEditRequest(timeoutSeconds: UShort): Unit