wotpy.protocols.zenoh.handlers.property

Zenoh handler for Property reads, writes and subscriptions to value updates.

Classes

PropertyZenohHandler(zenoh_server[, callback_ms])

Zenoh handler for Property reads, writes and subscriptions to value updates.

class wotpy.protocols.zenoh.handlers.property.PropertyZenohHandler(zenoh_server, callback_ms=None)

Bases: BaseZenohHandler

Zenoh handler for Property reads, writes and subscriptions to value updates.

ACTION_READ = 'read'
ACTION_WRITE = 'write'
DEFAULT_CALLBACK_MS = 2000
DEFAULT_JITTER = 0.2
KEY_ACK = 'ack'
KEY_ACTION = 'action'
KEY_VALUE = 'value'
build_property_updates_topic(thing, prop)

Returns the Zenoh topic for Property updates.

async handle_message(sample)

Listens to all Property request topics and responds to read and write requests.

async init()

Initializes the Zenoh handler. Called when the Zenoh runner starts.

async publish_write_ack(sample)

Takes a Property write request message and publishes the related write ACK message.

async teardown()

Destroys the Zenoh handler. Called when the Zenoh runner stops.

classmethod to_write_ack_topic(requests_topic)

Takes a Property requests topic and returns the related write ACK topic.

property topic_wildcard_requests

Wildcard topic to subscribe to all Property requests.

property topics

List of topics that this Zenoh handler wants to subscribe to.