wotpy.wot.consumed.thing
Class that represents a Thing consumed by a servient.
Classes
|
An entity that serves to interact with a Thing. |
- class wotpy.wot.consumed.thing.ConsumedThing(servient, td)
Bases:
objectAn entity that serves to interact with a Thing. An application uses this class when it acts as a client of the Thing.
- property actions
Returns a dictionary of ThingAction items.
- property events
Returns a dictionary of ThingEvent items.
- async 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.
- property links
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.
- property properties
Returns a dictionary of ThingProperty items.
- async 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.
- property servient
Returns the Servient that contains this Consumed Thing.
- subscribe(*args, **kwargs)
Subscribes to changes on the TD of this thing.
- property td
Returns the ThingDescription instance that represents the TD that this Consumed Thing is based on.
- async 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.