wotpy.wot.exposed.interaction_map

Classes that represent Interaction instances accessed on a ExposedThing.

Classes

ExposedThingAction(exposed_thing, name) The ThingAction interface implementation for ExposedThing objects.
ExposedThingActionDict(*args, **kwargs) A dictionary that provides lazy access to the objects that implement the ThingAction interface for each action in a given ExposedThing.
ExposedThingEvent(exposed_thing, name) The ThingEvent interface implementation for ExposedThing objects.
ExposedThingEventDict(*args, **kwargs) A dictionary that provides lazy access to the objects that implement the ThingEvent interface for each event in a given ExposedThing.
ExposedThingInteractionDict(*args, **kwargs) A dictionary that provides lazy access to the objects that implement the Interaction interface for each interaction in a given ExposedThing.
ExposedThingProperty(exposed_thing, name) The ThingProperty interface implementation for ExposedThing objects.
ExposedThingPropertyDict(*args, **kwargs) A dictionary that provides lazy access to the objects that implement the ThingProperty interface for each property in a given ExposedThing.
class wotpy.wot.exposed.interaction_map.ExposedThingAction(exposed_thing, name)

Bases: object

The ThingAction interface implementation for ExposedThing objects.

invoke(*args)

The run() method when invoked, starts the Action interaction with the input value provided by the inputValue argument.

class wotpy.wot.exposed.interaction_map.ExposedThingActionDict(*args, **kwargs)

Bases: wotpy.wot.exposed.interaction_map.ExposedThingInteractionDict

A dictionary that provides lazy access to the objects that implement the ThingAction interface for each action in a given ExposedThing.

interaction_dict

Returns the InteractionPattern objects dict by name.

thing_interaction_class

Returns the class that implements the Interaction interface for this type of interaction.

class wotpy.wot.exposed.interaction_map.ExposedThingEvent(exposed_thing, name)

Bases: object

The ThingEvent interface implementation for ExposedThing objects.

emit(payload)

Emits an event that carries data specified by the payload argument.

subscribe(*args, **kwargs)

Subscribe to an stream of emissions of this event.

class wotpy.wot.exposed.interaction_map.ExposedThingEventDict(*args, **kwargs)

Bases: wotpy.wot.exposed.interaction_map.ExposedThingInteractionDict

A dictionary that provides lazy access to the objects that implement the ThingEvent interface for each event in a given ExposedThing.

interaction_dict

Returns the InteractionPattern objects dict by name.

thing_interaction_class

Returns the class that implements the Interaction interface for this type of interaction.

class wotpy.wot.exposed.interaction_map.ExposedThingInteractionDict(*args, **kwargs)

Bases: collections.UserDict

A dictionary that provides lazy access to the objects that implement the Interaction interface for each interaction in a given ExposedThing.

interaction_dict

Returns the InteractionPattern objects dict by name.

thing_interaction_class

Returns the class that implements the Interaction interface for this type of interaction.

class wotpy.wot.exposed.interaction_map.ExposedThingProperty(exposed_thing, name)

Bases: object

The ThingProperty interface implementation for ExposedThing objects.

read()

The get() method will fetch the value of the Property. A coroutine that yields the value or raises an error.

subscribe(*args, **kwargs)

Subscribe to an stream of events emitted when the property value changes.

write(value)

The set() method will attempt to set the value of the Property specified in the value argument whose type SHOULD match the one specified by the type property. A coroutine that yields on success or raises an error.

class wotpy.wot.exposed.interaction_map.ExposedThingPropertyDict(*args, **kwargs)

Bases: wotpy.wot.exposed.interaction_map.ExposedThingInteractionDict

A dictionary that provides lazy access to the objects that implement the ThingProperty interface for each property in a given ExposedThing.

interaction_dict

Returns the InteractionPattern objects dict by name.

thing_interaction_class

Returns the class that implements the Interaction interface for this type of interaction.