Device
The Device object defines common attributes and methods supported by all components in the stack. Of course, these may be overwritten by classes derived from this.
Public methods
__init__(globalstate, unique_id) Creates an instance of this object.
The globalstate dictionary contains global state information, for example a reference to the connection with ha_iod opened by the calling program.
A unique_id should be handed over through which this object can be identified by the program that manages it. If none is given at invocation (and only then!), it is set to the Python-specific value None, and can be later set through attr_set(). Either way, the unique id is always converted to a string value.
__str__()
action_list()
Returns a list of strings indicating the actions supported by this object, that is, those that can be initiated by the action_trigger() method. If no actions are supported, returns an empty list.
action_trigger(action, args)
Action identifiers and argument format for the respective actions are listed on a separate page.
Returns True on success, False on failure, raises an exception on error as to be defined.
attr_list()
Returns a list of strings indicating which attributes may be get or set in this object.
attr_get(attr)
Returns the current value of the attribute named by the string attr. Raises an KeyError exception if attr is not a supported attribute.
attr_set(attr, value)
Sets the attribute named by the string attr to the value of appropriate type given in value. Raises an exception under the following conditions:
KeyError if attr is not a supported attribute
NoPermission if attr is read-only
TypeError if value is of inappropriate type (and this could be detected)
ValueError if value is of of invalid content (and this could be detected)
event_list()
Returns a list of strings, containing the names of events that software may register to receive, through the event_subscribe() method. If no events are supported, returns an empty list.
event_subscribe(event, callback_function)
Other functions can register to be notified when an event occurs through this function. Usually, the ha_control program will register its event handler here, which in turn takes responsibility of triggering actions when an event has been created by the Device object.
Events and the arguments that will be handed over to the callback function are defined on a separate page.
Returns True on success.
Returns False on failure, which will occur when:
- a function is trying to register for the same event a second time.
KeyError if the event is not supported by this object
identify()
This function returns a string identifying the respective class. Actually, this returns the devtype attribute.
uid()
This function returns the unique id of the device. If none has been set so far, it returns a temporary unique id as a string derived from the current system time, e.g. "TUID.DEVICE.20111231.090450".
Public attributes
devtype (string) read-only For this class, hardcoded to Device.
unique_id (string) special, see init()
Supported actions
none
Generated events
none
Configuration
base
active yes or no
If an object is marked active, it will be included in control activities. Objects not marked as active are not loaded when software reads its device configuration.
description (string)
A human-readable description of this object, for example dining room east wall lighting or tv set switch input
options (string)
Space-separated list of options to this module. The Device module supports no options, though.
unique id (string)
A system-wide unique identifier for this object, not neccesarily human-readable
class (string)
The name of the object class to load. For example, RelayOutput or ToggleButton.
THIS DATA IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS DATA, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
All product and brand names mentioned on there pages and in the source code are registered names and/or trademarks of the respective owner and are mentioned for identification purposes only.
For a full copyright notice, please see this link. For imprint and contact information, please see http://www.thiemo.net/.