wotpy.wot.events

Classes that represent events that are emitted by Things.

Classes

ActionInvocationEmittedEvent(init)

Event triggered to indicate an action invocation.

ActionInvocationEventInit(action_name, ...)

Represents the data contained in an action invocation event.

EmittedEvent(init, name)

Base event class.

PropertyChangeEmittedEvent(init)

Event triggered to indicate a property change.

PropertyChangeEventInit(name, value)

Represents the data contained in a property update event.

ThingDescriptionChangeEmittedEvent(init)

Event triggered to indicate a thing description change.

ThingDescriptionChangeEventInit(...[, data, ...])

Represents the data contained in a thing description update event.

class wotpy.wot.events.ActionInvocationEmittedEvent(init)

Bases: EmittedEvent

Event triggered to indicate an action invocation. Should be initialized with a ActionInvocationEventInit instance.

class wotpy.wot.events.ActionInvocationEventInit(action_name, return_value)

Bases: object

Represents the data contained in an action invocation event.

Parameters:
  • action_name (str) – Name of the property.

  • return_value – Result returned by the action invocation.

class wotpy.wot.events.EmittedEvent(init, name)

Bases: object

Base event class. Represents a generic event defined in a TD.

property data

Data property.

class wotpy.wot.events.PropertyChangeEmittedEvent(init)

Bases: EmittedEvent

Event triggered to indicate a property change. Should be initialized with a PropertyChangeEventInit instance.

class wotpy.wot.events.PropertyChangeEventInit(name, value)

Bases: object

Represents the data contained in a property update event.

Parameters:
  • name (str) – Name of the property.

  • value – Value of the property.

class wotpy.wot.events.ThingDescriptionChangeEmittedEvent(init)

Bases: EmittedEvent

Event triggered to indicate a thing description change. Should be initialized with a ThingDescriptionChangeEventInit instance.

class wotpy.wot.events.ThingDescriptionChangeEventInit(td_change_type, method, name, data=None, description=None)

Bases: object

Represents the data contained in a thing description update event.

Parameters:
  • td_change_type (str) – An item of enumeration TDChangeType.

  • method (str) – An item of enumeration TDChangeMethod.

  • name (str) – Name of the Interaction.

  • data – An instance of ThingPropertyInit, ThingActionInit or ThingEventInit (or None if the change did not add a new interaction).

  • description (dict) – A dict that represents a TD serialized to JSON-LD.