Fri, 19 Apr 2024 15:15:01 +0200
Modified the plugin for 'paho-mqtt' >=2.0.0.
# -*- coding: utf-8 -*- # Copyright (c) 2021 - 2024 Detlev Offenbach <detlev@die-offenbachs.de> # """ Module implementing an enum defining the supported MQTT protocol versions. """ import enum try: import paho.mqtt.client as mqtt class MqttProtocols(enum.IntEnum): """ Class defining the supported MQTT protocol versions. """ MQTTv31 = mqtt.MQTTv31 MQTTv311 = mqtt.MQTTv311 MQTTv5 = mqtt.MQTTv5 except ImportError: # define the enum with known values class MqttProtocols(enum.IntEnum): """ Class defining the supported MQTT protocol versions. """ MQTTv31 = 3 MQTTv311 = 4 MQTTv5 = 5