Module src.main.python.mqtt_message_handler_task

Expand source code
from task import Task


class MqttMessageHandlerTask(Task):

    def __init__(self):
        """ constructor """

    def __str__(self):
        """prints the object."""
        return "Message Handler Task"

    async def get_behaviour(self, topic, msg):
        print(str(topic, "utf-8") + " : " + str(msg, "utf-8"))
        # based on the message there is a change

Classes

class MqttMessageHandlerTask

Task with a behaviour that can be executed

constructor

Expand source code
class MqttMessageHandlerTask(Task):

    def __init__(self):
        """ constructor """

    def __str__(self):
        """prints the object."""
        return "Message Handler Task"

    async def get_behaviour(self, topic, msg):
        print(str(topic, "utf-8") + " : " + str(msg, "utf-8"))
        # based on the message there is a change

Ancestors

  • task.Task

Methods

async def get_behaviour(self, topic, msg)

":returns the behaviour of the task

Expand source code
async def get_behaviour(self, topic, msg):
    print(str(topic, "utf-8") + " : " + str(msg, "utf-8"))
    # based on the message there is a change