filip.clients.mqtt.encoder package

Submodules

filip.clients.mqtt.encoder.base_encoder module

Abstract class for all IoTA MQTT message encoders

class filip.clients.mqtt.encoder.base_encoder.BaseEncoder[source]

Bases: ABC

Abstract class for all IoTA MQTT message encoders

decode_message(msg: MQTTMessage, decoder: str = 'utf-8') Tuple[str, str, str][source]

Decode message for ingoing traffic :param msg: Message class :param decoder: encoding identifier

Returns:

apikey device_id payload

encode_msg(device_id: str, payload: Dict, msg_type: IoTAMQTTMessageType) str[source]

Encode message for outgoing traffic

Parameters:
  • device_id – id of the iot device

  • payload – payload to send

  • msg_type – kind of message to send

prefix: str = ''

filip.clients.mqtt.encoder.json module

Json encoder class for all IoTA-JSON MQTT message encoders

class filip.clients.mqtt.encoder.json.Json[source]

Bases: BaseEncoder

Json encoder class for all IoTA-JSON MQTT message encoders

decode_message(msg, decoder='utf-8') Tuple[str, str, Dict][source]

Decode message for ingoing traffic :param msg: Message class :param decoder: encoding identifier

Returns:

apikey device_id payload

encode_msg(device_id, payload: Any, msg_type: IoTAMQTTMessageType) str[source]

Encode message for outgoing traffic

Parameters:
  • device_id – id of the iot device

  • payload – payload to send

  • msg_type – kind of message to send

prefix: str = '/json'

filip.clients.mqtt.encoder.ulralight module

class filip.clients.mqtt.encoder.ulralight.Ultralight[source]

Bases: BaseEncoder

decode_message(msg, decoder='utf-8') Tuple[str, str, Dict][source]

Decode message for ingoing traffic :param msg: Message class :param decoder: encoding identifier

Returns:

apikey device_id payload

encode_msg(device_id: str, payload: Any, msg_type: IoTAMQTTMessageType) str[source]

Encode message for outgoing traffic

Parameters:
  • device_id – id of the iot device

  • payload – payload to send

  • msg_type – kind of message to send

prefix: str = '/ul'

Module contents