From 21b7c286921101d4c6128f09580318bd08038bb4 Mon Sep 17 00:00:00 2001 From: Danielle McLean Date: Sat, 13 Jul 2024 19:28:18 +1000 Subject: [PATCH] Add descriptions to websockets config --- schemata/config-v1.json | 2 ++ src/mpd_now_playable/config/model.py | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/schemata/config-v1.json b/schemata/config-v1.json index 8c0c9e6..a73d6cf 100644 --- a/schemata/config-v1.json +++ b/schemata/config-v1.json @@ -59,6 +59,7 @@ "type": "array" } ], + "description": "The hostname you'd like your WebSockets server to listen on. In most cases the default behaviour, which binds to all network interfaces, will be fine.", "title": "Host" }, "kind": { @@ -71,6 +72,7 @@ "type": "string" }, "port": { + "description": "The TCP port you'd like your WebSockets server to listen on. Should generally be higher than 1024, since mpd-now-playable doesn't normally run with the privilege to bind to low-numbered ports.", "maximum": 65535, "minimum": 1, "title": "Port", diff --git a/src/mpd_now_playable/config/model.py b/src/mpd_now_playable/config/model.py index 6935f96..561d830 100644 --- a/src/mpd_now_playable/config/model.py +++ b/src/mpd_now_playable/config/model.py @@ -28,7 +28,13 @@ class CocoaReceiverConfig(BaseReceiverConfig): @dataclass(slots=True, kw_only=True) class WebsocketsReceiverConfig(BaseReceiverConfig): kind: Literal["websockets"] = field(default="websockets", repr=False) + #: The TCP port you'd like your WebSockets server to listen on. Should + #: generally be higher than 1024, since mpd-now-playable doesn't normally + #: run with the privilege to bind to low-numbered ports. port: Port + #: The hostname you'd like your WebSockets server to listen on. In most + #: cases the default behaviour, which binds to all network interfaces, will + #: be fine. host: Optional[Host | tuple[Host, ...]] = None