Skip to content

Commit 452ae62

Browse files
committed
chore: fix lint errors in readme
1 parent b42202d commit 452ae62

File tree

1 file changed

+25
-23
lines changed

1 file changed

+25
-23
lines changed

roborock/devices/README.md

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,36 +13,36 @@ graph TB
1313
subgraph "Application Layer"
1414
User[Application Code]
1515
end
16-
16+
1717
subgraph "Device Management Layer"
1818
DM[DeviceManager]
1919
Traits[Device Traits]
2020
end
21-
21+
2222
subgraph "Channel Layer"
2323
V1C[V1Channel]
2424
RPC[RpcChannel]
2525
MC[MqttChannel]
2626
LC[LocalChannel]
2727
end
28-
28+
2929
subgraph "Session Layer"
3030
MS[MqttSession]
3131
LS[LocalSession Factory]
3232
end
33-
33+
3434
subgraph "Protocol Layer"
3535
Proto[Protocol Encoders/Decoders]
3636
V1P[V1 Protocol]
3737
A01P[A01 Protocol]
3838
B01P[B01 Protocol]
3939
end
40-
40+
4141
subgraph "Transport Layer"
4242
MQTT[MQTT Broker]
4343
TCP[TCP Socket]
4444
end
45-
45+
4646
User --> DM
4747
User --> Traits
4848
DM --> V1C
@@ -59,7 +59,7 @@ graph TB
5959
Proto --> B01P
6060
MS --> MQTT
6161
LC --> TCP
62-
62+
6363
style User fill:#e1f5ff
6464
style DM fill:#fff4e1
6565
style V1C fill:#ffe1e1
@@ -129,22 +129,22 @@ sequenceDiagram
129129
participant MS as MqttSession
130130
participant Broker as MQTT Broker
131131
participant Device as Vacuum Device
132-
132+
133133
App->>DM: create_device_manager()
134134
DM->>MS: Create MQTT Session
135135
MS->>Broker: Connect
136136
Broker-->>MS: Connected
137-
137+
138138
App->>DM: get_devices()
139139
DM->>V1C: Create V1Channel
140140
V1C->>MC: Create MqttChannel
141141
V1C->>LC: Create LocalChannel (if available)
142-
142+
143143
Note over V1C: Subscribe to device topics
144144
V1C->>MC: subscribe()
145145
MC->>MS: subscribe(topic, callback)
146146
MS->>Broker: SUBSCRIBE
147-
147+
148148
Note over V1C: Fetch network info via MQTT
149149
V1C->>RPC: send_command(GET_NETWORK_INFO)
150150
RPC->>MC: publish(request)
@@ -156,12 +156,12 @@ sequenceDiagram
156156
MS->>MC: callback(message)
157157
MC->>RPC: decoded message
158158
RPC-->>V1C: NetworkInfo
159-
159+
160160
Note over V1C: Connect locally using IP from NetworkInfo
161161
V1C->>LC: connect()
162162
LC->>Device: TCP Connect :58867
163163
Device-->>LC: Connected
164-
164+
165165
Note over V1C: Send command (prefers local)
166166
App->>V1C: send_command(GET_STATUS)
167167
V1C->>RPC: send_command()
@@ -172,6 +172,8 @@ sequenceDiagram
172172
RPC-->>App: Status
173173
```
174174

175+
176+
175177
### MQTT connection
176178

177179
- Initial device information must be obtained from MQTT
@@ -205,7 +207,7 @@ graph LR
205207
E -->|5. Match request_id| F[Future.set_result]
206208
F -->|6. Return| G[Command Result]
207209
end
208-
210+
209211
subgraph "Channel Layer"
210212
C --> H[Subscription Map]
211213
D --> I[Transport]
@@ -237,15 +239,15 @@ classDiagram
237239
+publish(message)
238240
+is_connected() bool
239241
}
240-
242+
241243
class MqttChannel {
242244
-MqttSession session
243245
-duid: str
244246
-local_key: str
245247
+subscribe(callback)
246248
+publish(message)
247249
}
248-
250+
249251
class LocalChannel {
250252
-host: str
251253
-transport: Transport
@@ -255,28 +257,28 @@ classDiagram
255257
+publish(message)
256258
+close()
257259
}
258-
260+
259261
class V1Channel {
260262
-MqttChannel mqtt_channel
261263
-LocalChannel local_channel
262264
-RpcChannel rpc_channel
263265
+send_command(method, params)
264266
+subscribe(callback)
265267
}
266-
268+
267269
class RpcChannel {
268270
-List~RpcStrategy~ strategies
269271
+send_command(method, params)
270272
}
271-
273+
272274
class RpcStrategy {
273275
+name: str
274276
+channel: Channel
275277
+encoder: Callable
276278
+decoder: Callable
277279
+health_manager: HealthManager
278280
}
279-
281+
280282
class MqttSession {
281283
-Client client
282284
-dict listeners
@@ -285,7 +287,7 @@ classDiagram
285287
+publish(topic, payload)
286288
+close()
287289
}
288-
290+
289291
Channel <|-- MqttChannel
290292
Channel <|-- LocalChannel
291293
Channel <|-- V1Channel
@@ -495,13 +497,13 @@ def mock_mqtt_channel():
495497
"""Mock MQTT channel that simulates responses."""
496498
channel = AsyncMock(spec=MqttChannel)
497499
channel.response_queue = []
498-
500+
499501
async def publish_side_effect(message):
500502
# Simulate device response
501503
if channel.response_queue:
502504
response = channel.response_queue.pop(0)
503505
await callback(response)
504-
506+
505507
channel.publish.side_effect = publish_side_effect
506508
return channel
507509
```

0 commit comments

Comments
 (0)