public class ThermostatDevice extends Device
Modifier and Type | Class and Description |
---|---|
static class |
ThermostatDevice.FanMode |
static class |
ThermostatDevice.Setpoint |
static class |
ThermostatDevice.SystemMode |
Modifier and Type | Field and Description |
---|---|
static DeviceType |
DEVICE_TYPE |
Constructor and Description |
---|
ThermostatDevice(com.mmbnetworks.rotarrandevicemodel.DeviceModel deviceModel,
DeviceConnectionType deviceConnectionType,
com.mmbnetworks.dialogues.DialogueManager dialogueManager,
Executor clientExecutor) |
Modifier and Type | Method and Description |
---|---|
Optional<CommandData> |
adjustSetpoint(ThermostatDevice.Setpoint setpoint,
int amount)
Adjusts the setpoint up or down by a specified amount.
|
PropertyCommandData |
changeFanMode(ThermostatDevice.FanMode fanMode)
Changes the
ThermostatDevice.FanMode of the Thermostat. |
PropertyCommandData |
changeMode(ThermostatDevice.SystemMode systemMode)
Changes the
ThermostatDevice.SystemMode of the Thermostat. |
CompletableFuture<String> |
enableDefaultReporting()
Configures the device to report changes to its properties to the
GatewayClient to which it is connected.
|
DeviceType |
getDeviceType()
Get the
DeviceType associated with the Device. |
Optional<Property> |
readCachedFanMode()
Reads the cached
ThermostatDevice.FanMode of the Thermostat. |
Optional<Property> |
readCachedMode()
Reads the cached
ThermostatDevice.SystemMode of the Thermostat. |
Optional<Property> |
readCachedRunningMode()
Reads the cached running mode of the thermostat device.
|
Optional<Property> |
readCachedSetpointLimit(ThermostatDevice.Setpoint setpoint)
Reads the cached setpoint of the thermostat device.
|
CompletableFuture<Property> |
readFanMode()
Reads the current
ThermostatDevice.FanMode of the Thermostat. |
CompletableFuture<Property> |
readMode()
Reads the current
ThermostatDevice.SystemMode of the Thermostat. |
CompletableFuture<Property> |
readRunningMode()
Reads the current running mode of the thermostat.
|
CompletableFuture<Property> |
readSetpointLimit(ThermostatDevice.Setpoint setpoint)
Reads the setpoint.
|
PropertyCommandData |
setSetpointLimit(ThermostatDevice.Setpoint setpoint,
double setpointLimit)
Sets the Heating or Cooling setpoint to a specific value.
|
accept, accept, addPropertyUpdateHandler, addProtocolHandler, addToGroup, bindDevice, callFunction, configureReporting, getCachedProperties, getCachedProperty, getCachedProtocolProperties, getConnectedGatewayId, getDeviceConnectionType, getID, getProperties, getProperty, getProtocolProperties, leaveNetwork, removeAllPropertyUpdateHandlers, removeAllProtocolHandlers, removeFromGroup, removePropertyUpdateHandler, removeProtocolHandler, sendProtocolMessage, unbindDevice, updateProperty
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
andThen
public static final DeviceType DEVICE_TYPE
public ThermostatDevice(com.mmbnetworks.rotarrandevicemodel.DeviceModel deviceModel, DeviceConnectionType deviceConnectionType, com.mmbnetworks.dialogues.DialogueManager dialogueManager, Executor clientExecutor)
public PropertyCommandData changeMode(ThermostatDevice.SystemMode systemMode)
ThermostatDevice.SystemMode
of the Thermostat.systemMode
- ThermostatDevice.SystemMode
PropertyCommandData
containing the results.public CompletableFuture<Property> readMode()
ThermostatDevice.SystemMode
of the Thermostat.CompletableFuture
containing the results.public Optional<Property> readCachedMode()
ThermostatDevice.SystemMode
of the Thermostat.
The cache is updated upon every invocation of readMode()
Optional
containing the results, empty if there is no cache valuepublic PropertyCommandData changeFanMode(ThermostatDevice.FanMode fanMode)
ThermostatDevice.FanMode
of the Thermostat.fanMode
- see ThermostatDevice.FanMode
PropertyCommandData
containing the results.public CompletableFuture<Property> readFanMode()
ThermostatDevice.FanMode
of the Thermostat.CompletableFuture
containing the results.public Optional<Property> readCachedFanMode()
ThermostatDevice.FanMode
of the Thermostat. This cache value is always updated upon successful
invocation of readFanMode()
Optional
contain the results, empty if there is no cache valuepublic Optional<CommandData> adjustSetpoint(ThermostatDevice.Setpoint setpoint, int amount)
setpoint
- Heat or Coolamount
- an amount in degrees celsiusCommandData
containing the results.public CompletableFuture<Property> readSetpointLimit(ThermostatDevice.Setpoint setpoint)
setpoint
- ThermostatDevice.Setpoint.HEAT
or ThermostatDevice.Setpoint.COOL
CompletableFuture
containing the results.public Optional<Property> readCachedSetpointLimit(ThermostatDevice.Setpoint setpoint)
readSetpointLimit(Setpoint)
setpoint
- ThermostatDevice.Setpoint.HEAT
or ThermostatDevice.Setpoint.COOL
Optional
contain the results, empty if no cache value existspublic PropertyCommandData setSetpointLimit(ThermostatDevice.Setpoint setpoint, double setpointLimit)
setpoint
- Heat or CoolsetpointLimit
- a specific value in degrees, in increments of 0.1 degrees (i.e. 2350 = 23.5 degrees)PropertyCommandData
containing the results.public CompletableFuture<Property> readRunningMode()
CompletableFuture
containing the results.public Optional<Property> readCachedRunningMode()
readRunningMode()
Optional
contains the results, empty if no cache value existspublic DeviceType getDeviceType()
DeviceType
associated with the Device.getDeviceType
in class Device
DeviceType
object.public CompletableFuture<String> enableDefaultReporting() throws IllegalStateException
enableDefaultReporting
in class Device
IllegalStateException
- if the function is called before
the device Properties have been discovered (i.e. through getProperties()).Copyright © 2019. All rights reserved.