diff --git a/heimdallr/entry_points/deprecated/publisher_non_sch.py b/heimdallr/entry_points/deprecated/publisher_non_sch.py index 3866433..24fe6ed 100644 --- a/heimdallr/entry_points/deprecated/publisher_non_sch.py +++ b/heimdallr/entry_points/deprecated/publisher_non_sch.py @@ -2,17 +2,14 @@ import socket import time -import paho.mqtt.client as mqtt +import paho.mqtt.client from draugr.writers import LogWriter, MockWriter, Writer +from warg import IgnoreInterruptSignal, NOD, busy_indicator, ensure_existence + +from heimdallr import PROJECT_APP_PATH, PROJECT_NAME from heimdallr.configuration.heimdallr_config import ALL_CONSTANTS from heimdallr.configuration.heimdallr_settings import HeimdallrSettings from heimdallr.utilities.publisher.unpacking import pull_gpu_info -from warg import IgnoreInterruptSignal -from warg import NOD -from warg import busy_indicator -from warg import ensure_existence - -from heimdallr import PROJECT_APP_PATH, PROJECT_NAME HOSTNAME = socket.gethostname() @@ -48,7 +45,7 @@ def main(is_user: bool = False): / f"{PROJECT_NAME}_publisher.log" ) LOG_WRITER.open() - client = mqtt.Client() + client = paho.mqtt.client.Client() client.on_publish = on_publish client.on_disconnect = on_disconnect diff --git a/heimdallr/entry_points/publisher.py b/heimdallr/entry_points/publisher.py index 88fb368..2512ddf 100644 --- a/heimdallr/entry_points/publisher.py +++ b/heimdallr/entry_points/publisher.py @@ -12,7 +12,7 @@ import time from typing import Any -import paho.mqtt.client as mqtt +import paho.mqtt.client import schedule # TODO: USE PENDULUM INSTEAD from draugr.writers import LogWriter, MockWriter, Writer from warg import NOD, busy_indicator, ensure_existence @@ -69,17 +69,17 @@ def main(setting_scope: SettingScopeEnum = SettingScopeEnum.user) -> None: / f"{PROJECT_NAME}_publisher.log" ) LOG_WRITER.open() - client = mqtt.Client( + client = paho.mqtt.client.Client( client_id=HOSTNAME, # userdata=None, - protocol=mqtt.MQTTv5, + protocol=paho.mqtt.client.MQTTv5, ) client.on_publish = on_publish # client.on_disconnect = on_disconnect heimdallr_settings = HeimdallrSettings(setting_scope) - client.tls_set(tls_version=mqtt.ssl.PROTOCOL_TLS) + client.tls_set(tls_version=paho.mqtt.client.ssl.PROTOCOL_TLS) client.username_pw_set( heimdallr_settings.mqtt_username, heimdallr_settings.mqtt_password diff --git a/heimdallr/entry_points/server.py b/heimdallr/entry_points/server.py index ca42087..d70104c 100644 --- a/heimdallr/entry_points/server.py +++ b/heimdallr/entry_points/server.py @@ -16,6 +16,7 @@ import dash import flask +import paho from dash import Dash from dash.dash_table import DataTable from dash.dependencies import Input, Output @@ -83,7 +84,7 @@ protocol=MQTTv5, # clean_session=True ) -MQTT_CLIENT.tls_set(tls_version=mqtt.ssl.PROTOCOL_TLS) +MQTT_CLIENT.tls_set(tls_version=paho.mqtt.client.ssl.PROTOCOL_TLS) DASH_APP = Dash( __name__, external_scripts=external_scripts,