Skip to content

Commit 0b6e17b

Browse files
committed
branding; test fixes
1 parent 8d09aa5 commit 0b6e17b

File tree

9 files changed

+799
-763
lines changed

9 files changed

+799
-763
lines changed

nowplaying/vendor/stagelinq/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
"""StageLinq Protocol Implementation for Python
1+
"""StagelinQ Protocol Implementation for Python
22
3-
This library implements Denon's StageLinq protocol, allowing Python applications
3+
This library implements Denon's StagelinQ protocol, allowing Python applications
44
to communicate with DJ equipment like Denon Prime series devices.
55
66
This implementation uses modern async/await patterns for all I/O operations.
@@ -12,7 +12,7 @@
1212
from .discovery import Device, DeviceState, DiscoveryConfig, discover_stagelinq_devices
1313
from .file_transfer import FileInfo, FileTransferConnection
1414
from .listener import (
15-
StageLinqListener,
15+
StagelinQListener,
1616
create_analytics_server,
1717
create_file_server,
1818
create_full_server,
@@ -45,7 +45,7 @@
4545
"FileTransferConnection",
4646
"FileInfo",
4747
"DeckValueNames",
48-
"StageLinqListener",
48+
"StagelinQListener",
4949
"create_analytics_server",
5050
"create_file_server",
5151
"create_full_server",

nowplaying/vendor/stagelinq/device.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""StageLinq device connection implementation."""
1+
"""StagelinQ device connection implementation."""
22

33
from __future__ import annotations
44

@@ -26,13 +26,13 @@
2626
Token,
2727
format_interval,
2828
)
29-
from .protocol import StageLinqConnection
29+
from .protocol import StagelinQConnection
3030

3131
logger = logging.getLogger(__name__)
3232

3333

3434
class DeviceRegistry:
35-
"""Collection of discovered StageLinq devices."""
35+
"""Collection of discovered StagelinQ devices."""
3636

3737
def __init__(self) -> None:
3838
self._devices: list[Device] = []
@@ -96,7 +96,7 @@ def __iter__(self):
9696

9797
@dataclass
9898
class Service:
99-
"""Represents a StageLinq service."""
99+
"""Represents a StagelinQ service."""
100100

101101
name: str
102102
port: int
@@ -116,7 +116,7 @@ class StateCategory(Enum):
116116

117117

118118
class StateValueType(Enum):
119-
"""StageLinq StateMap value types based on protocol documentation."""
119+
"""StagelinQ StateMap value types based on protocol documentation."""
120120

121121
VALUE_FLOAT = 0 # Float value (type 0)
122122
STATE_BOOL = 1 # Boolean state (type 1)
@@ -221,12 +221,12 @@ def __str__(self) -> str:
221221

222222

223223
class DeviceConnection:
224-
"""Pythonic async connection to a StageLinq device."""
224+
"""Pythonic async connection to a StagelinQ device."""
225225

226226
def __init__(self, device: Device, token: Token) -> None:
227227
self.device = device
228228
self.token = token
229-
self._connection: StageLinqConnection | None = None
229+
self._connection: StagelinQConnection | None = None
230230
self._services: list[Service] | None = None
231231

232232
async def __aenter__(self) -> DeviceConnection:
@@ -249,7 +249,7 @@ async def connect(self) -> None:
249249
return
250250

251251
try:
252-
self._connection = StageLinqConnection(self.device.ip, self.device.port)
252+
self._connection = StagelinQConnection(self.device.ip, self.device.port)
253253
await self._connection.connect()
254254
logger.info("Connected to device %s", self.device)
255255
except Exception as e:
@@ -283,7 +283,7 @@ async def discover_services(
283283

284284
# Implement proper service discovery protocol
285285
# Connect to main port and request services
286-
main_conn = StageLinqConnection(self.device.ip, self.device.port)
286+
main_conn = StagelinQConnection(self.device.ip, self.device.port)
287287
services = []
288288

289289
try:
@@ -405,15 +405,15 @@ def __init__(self, host: str, port: int, token: Token) -> None:
405405
self.host = host
406406
self.port = port
407407
self.token = token
408-
self._connection: StageLinqConnection | None = None
408+
self._connection: StagelinQConnection | None = None
409409
self._subscriptions: set[str] = set()
410410

411411
async def connect(self) -> None:
412412
"""Connect to StateMap service."""
413413
if self._connection:
414414
return
415415

416-
self._connection = StageLinqConnection(self.host, self.port)
416+
self._connection = StagelinQConnection(self.host, self.port)
417417
await self._connection.connect()
418418

419419
# Send service announcement message (required by protocol)
@@ -532,15 +532,15 @@ def __init__(self, host: str, port: int, token: Token) -> None:
532532
self.host = host
533533
self.port = port
534534
self.token = token
535-
self._connection: StageLinqConnection | None = None
535+
self._connection: StagelinQConnection | None = None
536536
self._streaming = False
537537

538538
async def connect(self) -> None:
539539
"""Connect to BeatInfo service."""
540540
if self._connection:
541541
return
542542

543-
self._connection = StageLinqConnection(self.host, self.port)
543+
self._connection = StagelinQConnection(self.host, self.port)
544544
await self._connection.connect()
545545
logger.info("Connected to BeatInfo at %s:%s", self.host, self.port)
546546

nowplaying/vendor/stagelinq/discovery.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""StageLinq device discovery implementation."""
1+
"""StagelinQ device discovery implementation."""
22

33
from __future__ import annotations
44

@@ -13,7 +13,7 @@
1313
import netifaces
1414

1515
from .messages import DISCOVERER_EXIT, DISCOVERER_HOWDY, DiscoveryMessage, Token
16-
from .protocol import StageLinqProtocol
16+
from .protocol import StagelinQProtocol
1717

1818
logger = logging.getLogger(__name__)
1919

@@ -27,7 +27,7 @@ class DeviceState(Enum):
2727

2828
@dataclass
2929
class Device:
30-
"""Represents a StageLinq device."""
30+
"""Represents a StagelinQ device."""
3131

3232
ip: str
3333
name: str
@@ -90,7 +90,7 @@ def from_discovery_message(
9090
class DiscoveryConfig:
9191
"""Configuration for device discovery."""
9292

93-
name: str = "Python StageLinq"
93+
name: str = "Python StagelinQ"
9494
software_name: str = "python-stagelinq"
9595
software_version: str = "0.1.0"
9696
token: Token | None = None
@@ -104,25 +104,25 @@ def __post_init__(self) -> None:
104104
self.token = Token()
105105

106106

107-
class StageLinqError(Exception):
108-
"""Base exception for StageLinq errors."""
107+
class StagelinQError(Exception):
108+
"""Base exception for StagelinQ errors."""
109109

110110

111-
class DiscoveryError(StageLinqError):
111+
class DiscoveryError(StagelinQError):
112112
"""Exception raised during device discovery."""
113113

114114

115-
class StageLinqDiscovery:
116-
"""Async StageLinq device discovery."""
115+
class StagelinQDiscovery:
116+
"""Async StagelinQ device discovery."""
117117

118118
def __init__(self, config: DiscoveryConfig | None = None) -> None:
119119
self.config = config or DiscoveryConfig()
120120
self._transport: asyncio.DatagramTransport | None = None
121-
self._protocol: StageLinqProtocol | None = None
121+
self._protocol: StagelinQProtocol | None = None
122122
self._announce_task: asyncio.Task | None = None
123123
self._discovered_devices: dict[str, Device] = {}
124124

125-
async def __aenter__(self) -> StageLinqDiscovery:
125+
async def __aenter__(self) -> StagelinQDiscovery:
126126
"""Async context manager entry."""
127127
await self.start()
128128
return self
@@ -143,12 +143,12 @@ async def start(self) -> None:
143143

144144
loop = asyncio.get_event_loop()
145145
self._transport, self._protocol = await loop.create_datagram_endpoint(
146-
lambda: StageLinqProtocol(self._on_message_received),
146+
lambda: StagelinQProtocol(self._on_message_received),
147147
local_addr=("0.0.0.0", self.config.port),
148148
reuse_port=True,
149149
)
150150

151-
logger.info("Started StageLinq discovery on port %s", self.config.port)
151+
logger.info("Started StagelinQ discovery on port %s", self.config.port)
152152

153153
async def stop(self) -> None:
154154
"""Stop discovery service."""
@@ -162,7 +162,7 @@ async def stop(self) -> None:
162162
self._transport.close()
163163
self._transport = None
164164

165-
logger.info("Stopped StageLinq discovery")
165+
logger.info("Stopped StagelinQ discovery")
166166

167167
async def start_announcing(self) -> None:
168168
"""Start periodic announcements."""
@@ -298,9 +298,9 @@ def discovered_devices(self) -> dict[str, Device]:
298298
@contextlib.asynccontextmanager
299299
async def discover_stagelinq_devices(
300300
config: DiscoveryConfig | None = None,
301-
) -> AsyncIterator[StageLinqDiscovery]:
302-
"""Context manager for StageLinq device discovery."""
303-
discovery = StageLinqDiscovery(config)
301+
) -> AsyncIterator[StagelinQDiscovery]:
302+
"""Context manager for StagelinQ device discovery."""
303+
discovery = StagelinQDiscovery(config)
304304
try:
305305
await discovery.start()
306306
yield discovery

nowplaying/vendor/stagelinq/file_transfer.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""StageLinq file transfer implementation.
1+
"""StagelinQ file transfer implementation.
22
33
Based on the FileTransfer protocol analysis from:
44
https://github.com/icedream/go-stagelinq/issues/8
@@ -89,7 +89,7 @@
8989
from typing import BinaryIO
9090

9191
from .messages import Message, Token, serializer
92-
from .protocol import StageLinqConnection
92+
from .protocol import StagelinQConnection
9393

9494
logger = logging.getLogger(__name__)
9595

@@ -118,7 +118,7 @@
118118

119119
@dataclass
120120
class FileInfo:
121-
"""Information about a file on the StageLinq device."""
121+
"""Information about a file on the StagelinQ device."""
122122

123123
path: str
124124
name: str
@@ -134,7 +134,7 @@ def __str__(self) -> str:
134134

135135
@dataclass
136136
class FileSource:
137-
"""Information about a file source on the StageLinq device."""
137+
"""Information about a file source on the StagelinQ device."""
138138

139139
name: str
140140
database_path: str
@@ -588,7 +588,7 @@ def __init__(self, host: str, port: int, token: Token) -> None:
588588
self.host = host
589589
self.port = port
590590
self.token = token
591-
self._connection: StageLinqConnection | None = None
591+
self._connection: StagelinQConnection | None = None
592592
self._sources: list[FileSource] = []
593593
self._next_request_id = 1
594594
self._directory_cache: dict[str, list[FileInfo]] = {} # path -> files
@@ -620,7 +620,7 @@ async def connect(self) -> None:
620620
return
621621

622622
try:
623-
self._connection = StageLinqConnection(self.host, self.port)
623+
self._connection = StagelinQConnection(self.host, self.port)
624624
await self._connection.connect()
625625
logger.info("Connected to FileTransfer at %s:%s", self.host, self.port)
626626
except Exception as e:

0 commit comments

Comments
 (0)