mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-08-10 18:53:03 +02:00
Merge pull request #253 from MartinFournier/feature/community-mqtt-websocket-path
Add WebSocket path config for community MQTT
This commit is contained in:
@@ -61,6 +61,7 @@ class CommunityMqttSettings(Protocol):
|
||||
community_mqtt_iata: str
|
||||
community_mqtt_email: str
|
||||
community_mqtt_token_audience: str
|
||||
community_mqtt_websocket_path: str
|
||||
|
||||
|
||||
def _base64url_encode(data: bytes) -> str:
|
||||
@@ -363,7 +364,7 @@ class CommunityMqttPublisher(BaseMqttPublisher):
|
||||
kwargs["username"] = s.community_mqtt_username or None
|
||||
kwargs["password"] = s.community_mqtt_password or None
|
||||
if transport == "websockets":
|
||||
kwargs["websocket_path"] = "/"
|
||||
kwargs["websocket_path"] = (s.community_mqtt_websocket_path or "").strip() or "/"
|
||||
return kwargs
|
||||
|
||||
def _on_connected(self, settings: object) -> tuple[str, str]:
|
||||
|
||||
@@ -62,6 +62,7 @@ def _config_to_settings(config: dict) -> SimpleNamespace:
|
||||
community_mqtt_iata=config.get("iata", ""),
|
||||
community_mqtt_email=config.get("email", ""),
|
||||
community_mqtt_token_audience=config.get("token_audience", ""),
|
||||
community_mqtt_websocket_path=config.get("websocket_path", "/"),
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user