Models

This page lists data models used through out the package

Actuator command received from WolkAbout IoT Platform.

class wolk_gateway_module.model.actuator_command.ActuatorCommand(reference: str, command: wolk_gateway_module.model.actuator_command.ActuatorCommandType, value: Union[bool, int, float, str, None] = None)[source]

Actuator command for reference with command and optionally value.

Variables:
class wolk_gateway_module.model.actuator_command.ActuatorCommandType[source]

Actuator command type.

Variables:
  • GET (int) – Get current actuator value
  • SET (int) – Set actuator to value

Actuator status model.

class wolk_gateway_module.model.actuator_status.ActuatorStatus(reference: str, state: wolk_gateway_module.model.actuator_state.ActuatorState, value: Union[bool, int, float, str, None] = None)[source]

Holds information of a devices actuator current status.

Variables:
  • reference (str) – Device actuator’s reference as defined in device template
  • state (ActuatorState) – Actuator’s current state
  • value (Optional[Union[bool, int, float, str]]) – Current value of actuator, None only for error state

Alarm event model.

class wolk_gateway_module.model.alarm.Alarm(reference: str, active: bool, timestamp: Optional[int])[source]

Holds information about a devices alarm.

Variables:
  • reference (str) – Device alarm’s reference as defined in device template
  • active (bool) – Alarm’s current state
  • timestamp (int or None) – Unix timestamp in miliseconds. If not provided, Platform will assign timestamp when it receives it.

Configuration command received from WolkAbout IoT Platform.

class wolk_gateway_module.model.configuration_command.ConfigurationCommand(command: wolk_gateway_module.model.configuration_command.ConfigurationCommandType, value: Optional[Dict[str, Union[int, float, bool, str, Tuple[int, int], Tuple[int, int, int], Tuple[float, float], Tuple[float, float, float], Tuple[str, str], Tuple[str, str, str]]]] = None)[source]

Configuration command with command and optionally value.

Variables:
  • command (int) – Configuration command received
  • value (Optional[dict]) – Set configuration to value
class wolk_gateway_module.model.configuration_command.ConfigurationCommandType[source]

Configuration command type.

Variables:
  • GET (int) – Get current configuration options
  • SET (int) – Set configuration to value

Device registration request model.

class wolk_gateway_module.model.device_registration_request.DeviceRegistrationRequest(name: str, key: str, template: wolk_gateway_module.model.device_template.DeviceTemplate = <factory>, default_binding: bool = True)[source]

Request for device registration.

Variables:
  • name (str) – Device name
  • key (str) – Unique device key
  • template (DeviceTemplate) – Device template
  • default_binding (bool) – Create semantic group for device on Platform

Response for device registration request.

class wolk_gateway_module.model.device_registration_response.DeviceRegistrationResponse(key: str, result: wolk_gateway_module.model.device_registration_response_result.DeviceRegistrationResponseResult, description: str = '')[source]

Response for device registration request.

Identified by device key and result, with an optional description of the error that occurred.

Variables:

Device registration response results.

class wolk_gateway_module.model.device_registration_response_result.DeviceRegistrationResponseResult[source]

Enumeration of possible registration response results.

Variables:
  • OK (str) – Device was successfully registered
  • ERROR_GATEWAY_NOT_FOUND (str) – Gateway that sent the registration request was not found
  • ERROR_NOT_A_GATEWAY (str) – Sender of request is not a gateway
  • ERROR_KEY_CONFLICT (str) – Device with that key already exists
  • ERROR_MAXIMUM_NUMBER_OF_DEVICES_EXCEEDED (str) – Reached limit for number of devices
  • ERROR_VALIDATION_ERROR (str) – Some data in the registration request was not valid
  • ERROR_INVALID_DTO (str) – The request was not valid - faulty JSON
  • ERROR_KEY_MISSING (str) – Device key was not provided
  • ERROR_SUBDEVICE_MANAGEMENT_FORBIDDEN (str) – Gateway is not able to register devices
  • ERROR_UNKNOWN (str) – Unknown error occurred

MQTT message model.

class wolk_gateway_module.model.message.Message(topic: str, payload: Union[str, bytes, bytearray, None] = None)[source]

MQTT message identified by topic and payload.

Variables:
  • topic (str) – Topic where the message is from or will be sent to
  • payload (bytes or str or bytearray or None) – Content of the message

Sensor reading model.

class wolk_gateway_module.model.sensor_reading.SensorReading(reference: str, value: Union[bool, int, float, str, Tuple[int, int], Tuple[int, int, int], Tuple[float, float], Tuple[float, float, float], Tuple[str, str], Tuple[str, str, str]], timestamp: Optional[int] = None)[source]

Holds information about a sensor reading.

Variables:
  • reference (str) – Device sensor’s reference as defined in device template
  • value (bool or int or float or str or Tuple[int, int] or Tuple[int, int, int] or Tuple[float, float] or Tuple[float, float, float] or Tuple[str, str] or Tuple[str, str, str]) – Data that the sensor reading yielded
  • timestamp (Optional[int]) – Unix timestamp in miliseconds. If not provided, Platform will assign timestamp when it receives it.