wotpy.wot.wot

Class that serves as the WoT entrypoint.

Classes

WoT(servient) The WoT object is the API entry point and it is exposed by an implementation of the WoT Runtime.
class wotpy.wot.wot.WoT(servient)

Bases: object

The WoT object is the API entry point and it is exposed by an implementation of the WoT Runtime. The WoT object does not expose properties, only methods for discovering, consuming and exposing a Thing.

consume(td_str)

Accepts a thing description string argument and returns a ConsumedThing object instantiated based on that description.

consume_from_url(url, timeout_secs=None)

Return a Future that resolves to a ConsumedThing created from the thing description retrieved from the given URL.

discover(thing_filter, dnssd_find_kwargs=None)

Starts the discovery process that will provide ThingDescriptions that match the optional argument filter of type ThingFilter.

classmethod fetch(url, timeout_secs=None)

Accepts an url argument and returns a Future that resolves with a Thing Description string.

produce(model)

Accepts a model argument of type ThingModel and returns an ExposedThing object, locally created based on the provided initialization parameters.

produce_from_url(url, timeout_secs=None)

Return a Future that resolves to an ExposedThing created from the thing description retrieved from the given URL.

register(directory, thing)

Generate the Thing Description as td, given the Properties, Actions and Events defined for this ExposedThing object. Then make a request to register td to the given WoT Thing Directory.

servient

Servient instance of this WoT entrypoint.

classmethod thing_from_model(model)

Takes a ThingModel and builds a Thing. Raises if the model has an unexpected type.

unregister(directory, thing)

Makes a request to unregister the thing from the given WoT Thing Directory.