Skip to content

Commit

Permalink
no alias
Browse files Browse the repository at this point in the history
  • Loading branch information
cnheider committed May 27, 2024
1 parent 2d73448 commit ed0a8cc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
13 changes: 5 additions & 8 deletions heimdallr/entry_points/deprecated/publisher_non_sch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions heimdallr/entry_points/publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion heimdallr/entry_points/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit ed0a8cc

Please sign in to comment.