The classes in this module are not meant to be used directly. They are mostly support classes for the higher level API described in tellcore.telldus (module).
Wrapper around the Telldus Core C API.
With the exception of tdInit, tdClose and tdReleaseString, all functions in the C API (see Telldus Core documentation) can be called. The parameters are the same as in the C API documentation. The return value are mostly the same as for the C API, except for functions with multiple out parameters.
- In addition, this class:
- automatically frees memory for strings returned from the C API,
- converts errors returned from functions into
- transparently converts between Python strings and C style strings.
Load and initialize the Telldus core library.
The underlaying library is only initialized the first time this object is created. Subsequent instances uses the same underlaying library instance.
- name (str) – If None than the platform specific name of the Telldus library is used, but it can be e.g. an absolute path.
- callback_dispatcher – If callbacks are to be used, this parameter
must refer to an instance of a class inheriting from
Close and unload the Telldus core library.
Any callback set up is removed.
The underlaying library is only closed and unloaded if this is the last instance sharing the same underlaying library instance.
Get the next controller while iterating.
Returns: a dict with the keys: id, type, name, available.
Get the next sensor while iterating.
Returns: a dict with the keys: protocol, model, id, datatypes.
tdSensorValue(protocol, model, sid, datatype)¶
Get the sensor value for a given sensor.
Returns: a dict with the keys: value, timestamp.
Error returned from Telldus Core API.
Automatically raised when a function in the C API returns an error.
- error: The error code constant (one of TELLSTICK_ERROR_* from
Return the human readable error string.
Base callback dispatcher class.
Inherit from this class and override the
on_callback()method to change how callbacks are dispatched.
Called from the callback thread when an event is received.
- callback (callable) – The callback function to call.
- args – The arguments to pass to the callback.