Skip to content

Commit

Permalink
MQTT fixed
Browse files Browse the repository at this point in the history
* Fixing paho-mqtt version
* livetime management mqtt client in fixture

Signed-off-by: Jan <[email protected]>
  • Loading branch information
djchhp committed Mar 7, 2024
1 parent a449ca8 commit a95e641
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion everest-testing/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ install_requires =
pytest
pytest-asyncio
python-dateutil
paho-mqtt
paho-mqtt ==1.6.1
pyftpdlib
ocpp
websockets
Expand Down
6 changes: 4 additions & 2 deletions everest-testing/src/everest/testing/core_utils/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,10 @@ def test_controller(request, tmp_path, everest_core) -> EverestTestController:
def connected_mqtt_client(everest_core: EverestCore) -> mqtt.Client:
mqtt_server_uri = os.environ.get("MQTT_SERVER_ADDRESS", "127.0.0.1")
mqtt_server_port = int(os.environ.get("MQTT_SERVER_PORT", "1883"))
client = mqtt.Client(mqtt.CallbackAPIVersion.VERSION2, everest_core.everest_uuid)
client = mqtt.Client(everest_core.everest_uuid)
client.connect(mqtt_server_uri, mqtt_server_port)
client.loop_start()

return client
yield client

client.loop_stop()

0 comments on commit a95e641

Please sign in to comment.