diff --git a/evrec/settings.py b/evrec/settings.py index 8b0261a..638f5c4 100644 --- a/evrec/settings.py +++ b/evrec/settings.py @@ -18,7 +18,7 @@ class MQTT(BaseModel): - broker: MqttUrl + broker: MqttUrl = Field(default="mqtt://localhost") username: str | None = None password: str | None = None topic_read: str diff --git a/tests/test_mqtt.py b/tests/test_mqtt.py index abcc19e..c816c15 100644 --- a/tests/test_mqtt.py +++ b/tests/test_mqtt.py @@ -1,12 +1,9 @@ from evrec.server import EvrecServer -from evrec.settings import Settings +from evrec.settings import MQTT, Settings def test_server(): settings = Settings( - clients_database="clients", - mqtt_broker=None, - mqtt_topic_read="read", - mqtt_topic_write="write", + clients_database="clients", mqtt=MQTT(topic_read="read", topic_write="write") ) _ = EvrecServer(settings)