diff --git a/SiliconTorch/MQTT.py b/SiliconTorch/MQTT.py index 9089175196ad8947c2d29ce72c1655282b37363d..4dbf9b6245fcb5f236605dad1631a3be69eb2eb8 100644 --- a/SiliconTorch/MQTT.py +++ b/SiliconTorch/MQTT.py @@ -1,11 +1,12 @@ -from typing import Callable import yaml import json import random import logging import paho.mqtt.client as mqtt +from typing import Callable + ######################################## #### #### @@ -372,6 +373,13 @@ class SpiderMQTT: return self.connected def publish(self, topic, payload=None, qos=0, retain=False, prettyPrintYAML=False) -> None: + + # ###################################################### + # ### USE issubclass(…) INSTEAD AND TEST FOR IT!!! ### + # ###################################################### + + # what we did here is bad style and contrary to what we want to achieve :/ + if isinstance(payload, str): pl = payload.encode('utf-8') elif isinstance(payload, (bool, int, float, complex)):