public class CliRepository extends Object implements org.ezand.telldus.core.repository.TelldusRepository
Constructor and Description |
---|
CliRepository(String tdtool) |
Modifier and Type | Method and Description |
---|---|
org.ezand.telldus.core.domain.State<String> |
dimDevice(int id,
int level)
Will try to dim the device.
|
List<org.ezand.telldus.core.domain.Device> |
getDevices() |
org.ezand.telldus.core.domain.State<?> |
getDeviceState(int id) |
List<org.ezand.telldus.core.domain.Sensor> |
getSensors() |
org.ezand.telldus.core.domain.State<org.ezand.telldus.core.util.RichBoolean> |
turnDeviceOff(int id)
Will try to switch the device off.
|
org.ezand.telldus.core.domain.State<org.ezand.telldus.core.util.RichBoolean> |
turnDeviceOn(int id)
Will try to switch the device on.
|
public CliRepository(String tdtool)
public List<org.ezand.telldus.core.domain.Device> getDevices() throws org.ezand.telldus.core.TelldusException
getDevices
in interface org.ezand.telldus.core.repository.TelldusRepository
Device
objects.org.ezand.telldus.core.TelldusException
- if tdtool-command fails fatally.public List<org.ezand.telldus.core.domain.Sensor> getSensors() throws org.ezand.telldus.core.TelldusException
getSensors
in interface org.ezand.telldus.core.repository.TelldusRepository
Sensor
objects.org.ezand.telldus.core.TelldusException
- if tdtool-command fails fatally.public org.ezand.telldus.core.domain.State<?> getDeviceState(int id) throws org.ezand.telldus.core.TelldusException
getDeviceState
in interface org.ezand.telldus.core.repository.TelldusRepository
id
- the device id.State
object containing the device type and state.
For switches the state will be a RichBoolean
.
For dimmers the state will either be a RichBoolean
or the dim level. It depends on the
last sent command to the dimmer-device.org.ezand.telldus.core.TelldusException
- if tdtool-command fails fatally.public org.ezand.telldus.core.domain.State<org.ezand.telldus.core.util.RichBoolean> turnDeviceOn(int id) throws org.ezand.telldus.core.TelldusException
turnDeviceOn
in interface org.ezand.telldus.core.repository.TelldusRepository
id
- the device id.RichBoolean
instance with a positive value if device was switched on successfully, a negative value otherwise.org.ezand.telldus.core.TelldusException
- if tdtool-command fails fatally.public org.ezand.telldus.core.domain.State<org.ezand.telldus.core.util.RichBoolean> turnDeviceOff(int id) throws org.ezand.telldus.core.TelldusException
turnDeviceOff
in interface org.ezand.telldus.core.repository.TelldusRepository
id
- the device id.RichBoolean
instance with a negative value if device was switched off successfully, a positive value otherwise.org.ezand.telldus.core.TelldusException
- if tdtool-command fails fatally.public org.ezand.telldus.core.domain.State<String> dimDevice(int id, int level) throws org.ezand.telldus.core.TelldusException
dimDevice
in interface org.ezand.telldus.core.repository.TelldusRepository
id
- the device id.level
- the dim-level value (0-255).org.ezand.telldus.core.TelldusException
- if tdtool-command fails fatally or if the dim value
could not be retrieved from the command result.Copyright © 2015. All rights reserved.