wotpy.wot.consumed.thing

Class that represents a Thing consumed by a servient.

Classes

ConsumedThing(servient, td) An entity that serves to interact with a Thing.
class wotpy.wot.consumed.thing.ConsumedThing(servient, td)

Bases: object

An entity that serves to interact with a Thing. An application uses this class when it acts as a client of the Thing.

actions

Returns a dictionary of ThingAction items.

events

Returns a dictionary of ThingEvent items.

invoke_action(name, input_value=None, timeout=None, client_kwargs=None)

Takes the Action name from the name argument and the list of parameters, then requests from the underlying platform and the Protocol Bindings to invoke the Action on the remote Thing and return the result. Returns a Future that resolves with the return value or rejects with an Error.

Represents a dictionary of WebLink items.

on_event(name, client_kwargs=None)

Returns an Observable for the Event specified in the name argument, allowing subscribing to and unsubscribing from notifications.

on_property_change(name, client_kwargs=None)

Returns an Observable for the Property specified in the name argument, allowing subscribing to and unsubscribing from notifications.

on_td_change()

Returns an Observable, allowing subscribing to and unsubscribing from notifications to the Thing Description.

properties

Returns a dictionary of ThingProperty items.

read_property(name, timeout=None, client_kwargs=None)

Takes the Property name as the name argument, then requests from the underlying platform and the Protocol Bindings to retrieve the Property on the remote Thing and return the result. Returns a Future that resolves with the Property value or rejects with an Error.

servient

Returns the Servient that contains this Consumed Thing.

subscribe(*args, **kwargs)

Subscribes to changes on the TD of this thing.

td

Returns the ThingDescription instance that represents the TD that this Consumed Thing is based on.

write_property(name, value, timeout=None, client_kwargs=None)

Takes the Property name as the name argument and the new value as the value argument, then requests from the underlying platform and the Protocol Bindings to update the Property on the remote Thing and return the result. Returns a Future that resolves on success or rejects with an Error.