wotpy.protocols.coap.resources.action

CoAP resources to deal with Action interactions.

Functions

get_thing_action(server, request) Takes a CoAP request and returns the Thing Action identified by the request arguments.

Classes

ActionResource(server[, clear_ms]) CoAP resource to invoke Actions and observe those invocations.
class wotpy.protocols.coap.resources.action.ActionResource(server, clear_ms=None)

Bases: aiocoap.resource.ObservableResource

CoAP resource to invoke Actions and observe those invocations.

DEFAULT_CLEAR_MS = 300000
add_observation(request, server_observation)

Method that decides whether to add a new observer. Observers are added for GET requests (checks for invocation status) but not for POST requests (action invocations).

render_get(request)

Handler to check the status of an ongoing invocation.

render_post(request)

Handler for action invocations.

wotpy.protocols.coap.resources.action.get_thing_action(server, request)

Takes a CoAP request and returns the Thing Action identified by the request arguments.