Module: telldus¶
-
class
telldus.
DeviceManager
¶ The devicemanager holds and manages all the devices in the server
-
addDevice
(**kwargs)¶ Call this function to register a new device to the device manager.
Note
The
localId()
function in the device must return a unique id for the transport type returned bytypeString()
Note
Calls to this method are threadsafe.
-
device
(deviceId)¶ Retrieves a device.
- Returns:
- the device specified by deviceId or None of no device was found
-
finishedLoading
(**kwargs)¶ Finished loading all devices of this type. If there are any unconfirmed, these should be deleted
Note
Calls to this method are threadsafe.
-
removeDevice
(**kwargs)¶ Removes a device.
Warning
This function may only be called by the module supplying the device since removing of a device may be transport specific.
Note
Calls to this method are threadsafe.
-
retrieveDevices
(deviceType=None)¶ Retrieve a list of devices.
- Args:
deviceType: If this parameter is set only devices with this type is returned - Returns:
- Returns a list of devices
-
-
class
telldus.
IDeviceChange
¶ Bases:
base.Plugin.IInterface
Implement this IInterface to recieve notifications on device changes
-
deviceAdded
()¶ This method is called when a device is added
-
deviceConfirmed
()¶ This method is called when a device is confirmed on the network, not only loaded from storage (not applicable to all device types)
-
deviceRemoved
()¶ This method is called when a device is removed
-
sensorValueUpdated
(valueType, value, scale)¶ This method is called when a new sensor value is received from a sensor
-
stateChanged
(state, statevalue)¶ Called when the state of a device changed
-
-
class
telldus.
Device
¶ A base class for a device. Any plugin adding devices must subclass this class.
-
BAROMETRIC_PRESSURE
= 2048¶ Sensor type flag for barometric pressure
-
BELL
= 4¶ Device flag for devices supporting the bell method.
-
DEW_POINT
= 1024¶ Sensor type flag for dew point
-
DIM
= 16¶ Device flag for devices supporting the dim method.
-
DOWN
= 256¶ Device flag for devices supporting the down method.
-
EXECUTE
= 64¶ Device flag for devices supporting the execute method.
-
HUMIDITY
= 2¶ Sensor type flag for humidity
-
LEARN
= 32¶ Device flag for devices supporting the learn method.
-
LUMINANCE
= 512¶ Sensor type flag for luminance
-
RAINRATE
= 4¶ Sensor type flag for rain rate
-
RAINTOTAL
= 8¶ Sensor type flag for rain total
-
RGBW
= 1024¶ Device flag for devices supporting the rgbw method.
-
STOP
= 512¶ Device flag for devices supporting the stop method.
-
TEMPERATURE
= 1¶ Sensor type flag for temperature
-
THERMOSTAT
= 2048¶ Device flag for devices supporting thermostat methods.
-
TOGGLE
= 8¶ Device flag for devices supporting the toggle method.
-
TURNOFF
= 2¶ Device flag for devices supporting the off method.
-
TURNON
= 1¶ Device flag for devices supporting the on method.
-
UNKNOWN
= 0¶ Sensor type flag for an unknown type
-
UP
= 128¶ Device flag for devices supporting the up method.
-
UV
= 128¶ Sensor type flag for uv
-
WATT
= 256¶ Sensor type flag for watt
-
WINDAVERAGE
= 32¶ Sensor type flag for wind average
-
WINDDIRECTION
= 16¶ Sensor type flag for wind direction
-
WINDGUST
= 64¶ Sensor type flag for wind gust
-
_command
(action, value, success, failure, **kwargs)¶ Reimplement this method to execute an action to this device.
-
battery
()¶ Returns the current battery value
-
command
(action, value=None, origin=None, success=None, failure=None, callbackArgs=[], ignore=None)¶ This method executes a method with the device. This method must not be subclassed. Please subclass
_command()
instead.param action: description return: return description Here below is the results of the
Device.methods()
docstring.
-
isDevice
()¶ Return True if this is a device.
-
isSensor
()¶ Return True if this is a sensor.
-
localId
()¶ This method must be reimplemented in the subclass. Return a unique id for this device type.
-
static
methodStrToInt
(method)¶ Convenience method to convert method string to constants.
Example: “turnon” => Device.TURNON
-
methods
()¶ Return the methods this supports. This is an or-ed in of device method flags.
Example: return Device.TURNON | Device.TURNOFF
-
sensorValue
(valueType, scale)¶ Returns a sensor value of a the specified valueType and scale. Returns None is no such value exists
-
sensorValues
()¶ Returns a list of all sensor values this device has received.
-
state
()¶ Returns a tuple of the device state and state value
Example: state, stateValue = device.state()
-
typeString
()¶ Must be reimplemented by subclass. Return the type (transport) of this device. All devices from a plugin must have the same type.
-