Skip to content

Commit 1cb6322

Browse files
committed
Update error message and add pydoc for exception handling on subscribe
1 parent f477a3b commit 1cb6322

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

roborock/devices/device_manager.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,7 @@ def device_creator(device: HomeDataDevice, product: HomeDataProduct) -> Roborock
118118
if device.pv != DeviceVersion.V1.value:
119119
raise NotImplementedError(
120120
f"Device {device.name} has version {device.pv}, but only V1 devices "
121-
f"are supported through the unified interface. Use the legacy "
122-
f"RoborockMqttClientV1 or RoborockLocalClientV1 for this device."
121+
f"are supported through the unified interface."
123122
)
124123
# Create V1 channel that handles both MQTT and local connections
125124
v1_channel = create_v1_channel(user_data, mqtt_params, mqtt_session, device)

roborock/devices/v1_channel.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ async def subscribe(self, callback: Callable[[RoborockMessage], None]) -> Callab
8080
"""Subscribe to all messages from the device.
8181
8282
This will establish MQTT connection first, and also attempt to set up
83-
local connection if possible.
83+
local connection if possible. Any failures to subscribe to MQTT will raise
84+
a RoborockException. A local connection failure will not raise an exception,
85+
since the local connection is optional.
8486
"""
8587

8688
if self._mqtt_unsub:

0 commit comments

Comments
 (0)