wotpy.wot.interaction

Classes that represent all interaction patterns.

Classes

Action(thing, name[, init_dict])

Actions offer functions of the Thing.

Event(thing, name[, init_dict])

The Event Interaction Pattern describes event sources that asynchronously push messages.

InteractionPattern(thing, name[, init_dict])

A functionality exposed by Thing that is defined by the TD Interaction Model.

Property(thing, name[, init_dict])

Properties expose internal state of a Thing that can be directly accessed (get) and optionally manipulated (set).

class wotpy.wot.interaction.Action(thing, name, init_dict=None, **kwargs)

Bases: InteractionPattern

Actions offer functions of the Thing. These functions may manipulate the internal state of a Thing in a way that is not possible through setting Properties.

property init_class

Returns the init dict class for this type of interaction.

property interaction_type

Interaction type.

class wotpy.wot.interaction.Event(thing, name, init_dict=None, **kwargs)

Bases: InteractionPattern

The Event Interaction Pattern describes event sources that asynchronously push messages. Here not state, but state transitions (events) are communicated (e.g., clicked).

property init_class

Returns the init dict class for this type of interaction.

property interaction_type

Interaction type.

class wotpy.wot.interaction.InteractionPattern(thing, name, init_dict=None, **kwargs)

Bases: object

A functionality exposed by Thing that is defined by the TD Interaction Model.

add_form(form)

Add a new autogenerated Form.

clean_forms()

Removes all autogenerated Forms from this Interaction.

property forms

Sequence of forms linked to this interaction.

abstract property init_class

Returns the init dict class for this type of interaction.

property interaction_fragment

The InteractionFragment dictionary of this interaction.

property name

Interaction name. No two Interactions with the same name may exist in a Thing.

remove_form(form)

Remove an existing autogenerated Form.

property thing

Thing that contains this Interaction.

property url_name

URL-safe version of the name.

class wotpy.wot.interaction.Property(thing, name, init_dict=None, **kwargs)

Bases: InteractionPattern

Properties expose internal state of a Thing that can be directly accessed (get) and optionally manipulated (set).

property init_class

Returns the init dict class for this type of interaction.

property interaction_type

Interaction type.