Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 44 additions & 44 deletions tests/e2e/__snapshots__/test_device_manager.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -267,61 +267,61 @@
[mqtt <]
00000000 20 09 02 00 06 22 00 0a 21 00 14 | ...."..!..|
[mqtt >]
00000000 82 2e 00 01 00 00 28 72 72 2f 6d 2f 6f 2f 75 73 |......(rr/m/o/us|
00000000 82 2a 00 01 00 00 24 72 72 2f 6d 2f 6f 2f 75 73 |.*....$rr/m/o/us|
00000010 65 72 31 32 33 2f 31 39 36 34 38 66 39 34 2f 64 |er123/19648f94/d|
00000020 65 76 69 63 65 2d 69 64 2d 64 65 66 34 35 36 00 |evice-id-def456.|
00000020 65 76 69 63 65 2d 69 64 2d 71 37 00 |evice-id-q7.|
[mqtt <]
00000000 90 04 00 01 00 00 |......|
[mqtt >]
00000000 30 b2 01 00 28 72 72 2f 6d 2f 69 2f 75 73 65 72 |0...(rr/m/i/user|
00000000 30 ae 01 00 24 72 72 2f 6d 2f 69 2f 75 73 65 72 |0...$rr/m/i/user|
00000010 31 32 33 2f 31 39 36 34 38 66 39 34 2f 64 65 76 |123/19648f94/dev|
00000020 69 63 65 2d 69 64 2d 64 65 66 34 35 36 00 42 30 |ice-id-def456.B0|
00000030 31 00 00 23 83 00 00 23 84 68 a6 a2 25 00 65 00 |1..#...#.h..%.e.|
00000040 70 9f 24 5b c1 48 2b c9 07 ca c3 e1 c5 01 06 3e |p.$[.H+........>|
00000050 62 44 d8 8d 7c 45 19 47 5c 53 87 fe 1a a7 a5 0d |bD..|E.G\S......|
00000060 b4 a8 b5 7e 19 75 8a 4f 0a 37 ca d0 1f d0 a1 5b |...~.u.O.7.....[|
00000070 e8 ef 45 75 73 aa dd 84 c8 ec d6 c2 e7 64 43 c3 |..Eus........dC.|
00000080 58 8a 31 7a c0 45 0a 5f 06 b6 4f a3 e1 73 05 58 |X.1z.E._..O..s.X|
00000090 b4 71 2b c3 cf e5 68 8a db de a2 3f 1a f7 8e 6d |.q+...h....?...m|
000000a0 ab a4 7f 71 34 c2 93 83 01 7d cd 1e b3 78 c1 d7 |...q4....}...x..|
000000b0 dc 0c 71 b2 86 |..q..|
00000020 69 63 65 2d 69 64 2d 71 37 00 42 30 31 00 00 23 |ice-id-q7.B01..#|
00000030 83 00 00 23 84 68 a6 a2 25 00 65 00 70 9f 24 5b |...#.h..%.e.p.$[|
00000040 c1 48 2b c9 07 ca c3 e1 c5 01 06 3e 62 44 d8 8d |.H+........>bD..|
00000050 7c 45 19 47 5c 53 87 fe 1a a7 a5 0d b4 a8 b5 7e ||E.G\S.........~|
00000060 19 75 8a 4f 0a 37 ca d0 1f d0 a1 5b e8 ef 45 75 |.u.O.7.....[..Eu|
00000070 73 aa dd 84 c8 ec d6 c2 e7 64 43 c3 58 8a 31 7a |s........dC.X.1z|
00000080 c0 45 0a 5f 06 b6 4f a3 e1 73 05 58 b4 71 2b c3 |.E._..O..s.X.q+.|
00000090 cf e5 68 8a db de a2 3f 1a f7 8e 6d ab a4 7f 71 |..h....?...m...q|
000000a0 34 c2 93 83 01 7d cd 1e b3 78 c1 d7 dc 0c 71 b2 |4....}...x....q.|
000000b0 86 |.|
[mqtt <]
00000000 30 96 01 00 28 72 72 2f 6d 2f 6f 2f 75 73 65 72 |0...(rr/m/o/user|
00000000 30 92 01 00 24 72 72 2f 6d 2f 6f 2f 75 73 65 72 |0...$rr/m/o/user|
00000010 31 32 33 2f 31 39 36 34 38 66 39 34 2f 64 65 76 |123/19648f94/dev|
00000020 69 63 65 2d 69 64 2d 64 65 66 34 35 36 00 00 00 |ice-id-def456...|
00000030 00 67 42 30 31 00 00 00 01 00 00 00 17 68 a6 a2 |.gB01........h..|
00000040 23 00 66 00 50 cc c9 4f 81 fd b0 4c 46 6d d7 bb |#.f.P..O...LFm..|
00000050 aa 87 d8 e5 84 54 b7 5b 58 22 d3 d1 53 d0 1d b8 |.....T.[X"..S...|
00000060 6f 11 53 4f 77 21 a1 a5 8b 05 7f 9e b7 62 88 df |o.SOw!.......b..|
00000070 57 1b fe 50 f0 9a 70 bc e1 ad c3 f7 cc f7 3f e4 |W..P..p.......?.|
00000080 6a dd 1d f5 d2 4a 6d 4d 48 4f b5 75 07 70 7d bf |j....JmMHO.u.p}.|
00000090 c5 b9 3f e7 73 4b d9 19 cd |..?.sK...|
00000020 69 63 65 2d 69 64 2d 71 37 00 00 00 00 67 42 30 |ice-id-q7....gB0|
00000030 31 00 00 00 01 00 00 00 17 68 a6 a2 23 00 66 00 |1........h..#.f.|
00000040 50 cc c9 4f 81 fd b0 4c 46 6d d7 bb aa 87 d8 e5 |P..O...LFm......|
00000050 84 54 b7 5b 58 22 d3 d1 53 d0 1d b8 6f 11 53 4f |.T.[X"..S...o.SO|
00000060 77 21 a1 a5 8b 05 7f 9e b7 62 88 df 57 1b fe 50 |w!.......b..W..P|
00000070 f0 9a 70 bc e1 ad c3 f7 cc f7 3f e4 6a dd 1d f5 |..p.......?.j...|
00000080 d2 4a 6d 4d 48 4f b5 75 07 70 7d bf c5 b9 3f e7 |.JmMHO.u.p}...?.|
00000090 73 4b d9 19 cd |sK...|
[mqtt >]
00000000 30 e2 01 00 28 72 72 2f 6d 2f 69 2f 75 73 65 72 |0...(rr/m/i/user|
00000000 30 de 01 00 24 72 72 2f 6d 2f 69 2f 75 73 65 72 |0...$rr/m/i/user|
00000010 31 32 33 2f 31 39 36 34 38 66 39 34 2f 64 65 76 |123/19648f94/dev|
00000020 69 63 65 2d 69 64 2d 64 65 66 34 35 36 00 42 30 |ice-id-def456.B0|
00000030 31 00 00 23 86 00 00 23 87 68 a6 a2 26 00 65 00 |1..#...#.h..&.e.|
00000040 a0 4d ae db 7c ad db 6f 8e 4a 1b 01 4c 2b fd fd |.M..|..o.J..L+..|
00000050 1b 4f df 4c 64 fb 3b ed a6 fc 9f e2 21 e8 95 94 |.O.Ld.;.....!...|
00000060 49 6c 57 79 9c c5 8e 35 48 fc cc 29 f8 69 9b 54 |IlWy...5H..).i.T|
00000070 fb 42 33 7e 63 72 a6 17 0f 87 20 31 74 c3 bb 29 |.B3~cr.... 1t..)|
00000080 5b 6a f3 a7 23 bd 10 42 84 4b 6f 09 a5 6c 0b 3c |[j..#..B.Ko..l.<|
00000090 d0 0c a4 ba 90 be 70 27 43 73 35 bd 5f 47 bd 1b |......p'Cs5._G..|
000000a0 b4 e5 0b 98 50 ed 61 80 7d db 40 c1 ad 99 65 e1 |....P.a.}.@...e.|
000000b0 7e df a6 b8 7d ef 3b 08 92 c3 95 c7 46 a6 f7 32 |~...}.;.....F..2|
000000c0 b6 6d cb 21 72 b8 a1 ee 85 49 d6 2a 76 33 c0 01 |.m.!r....I.*v3..|
000000d0 c3 be fa 58 3d fa f2 72 50 84 e4 17 68 e5 21 00 |...X=..rP...h.!.|
000000e0 98 16 9c 62 43 |...bC|
00000020 69 63 65 2d 69 64 2d 71 37 00 42 30 31 00 00 23 |ice-id-q7.B01..#|
00000030 86 00 00 23 87 68 a6 a2 26 00 65 00 a0 4d ae db |...#.h..&.e..M..|
00000040 7c ad db 6f 8e 4a 1b 01 4c 2b fd fd 1b 4f df 4c ||..o.J..L+...O.L|
00000050 64 fb 3b ed a6 fc 9f e2 21 e8 95 94 49 6c 57 79 |d.;.....!...IlWy|
00000060 9c c5 8e 35 48 fc cc 29 f8 69 9b 54 fb 42 33 7e |...5H..).i.T.B3~|
00000070 63 72 a6 17 0f 87 20 31 74 c3 bb 29 5b 6a f3 a7 |cr.... 1t..)[j..|
00000080 23 bd 10 42 84 4b 6f 09 a5 6c 0b 3c d0 0c a4 ba |#..B.Ko..l.<....|
00000090 90 be 70 27 43 73 35 bd 5f 47 bd 1b b4 e5 0b 98 |..p'Cs5._G......|
000000a0 50 ed 61 80 7d db 40 c1 ad 99 65 e1 7e df a6 b8 |P.a.}.@...e.~...|
000000b0 7d ef 3b 08 92 c3 95 c7 46 a6 f7 32 b6 6d cb 21 |}.;.....F..2.m.!|
000000c0 72 b8 a1 ee 85 49 d6 2a 76 33 c0 01 c3 be fa 58 |r....I.*v3.....X|
000000d0 3d fa f2 72 50 84 e4 17 68 e5 21 00 98 16 9c 62 |=..rP...h.!....b|
000000e0 43 |C|
[mqtt <]
00000000 30 86 01 00 28 72 72 2f 6d 2f 6f 2f 75 73 65 72 |0...(rr/m/o/user|
00000000 30 82 01 00 24 72 72 2f 6d 2f 6f 2f 75 73 65 72 |0...$rr/m/o/user|
00000010 31 32 33 2f 31 39 36 34 38 66 39 34 2f 64 65 76 |123/19648f94/dev|
00000020 69 63 65 2d 69 64 2d 64 65 66 34 35 36 00 00 00 |ice-id-def456...|
00000030 00 57 42 30 31 00 00 00 02 00 00 00 17 68 a6 a2 |.WB01........h..|
00000040 24 00 66 00 40 cc c9 4f 81 fd b0 4c 46 6d d7 bb |$.f.@..O...LFm..|
00000050 aa 87 d8 e5 84 54 b7 5b 58 22 d3 d1 53 d0 1d b8 |.....T.[X"..S...|
00000060 6f 11 53 4f 77 2b ef a8 bf d2 66 05 8e ce 7f 08 |o.SOw+....f.....|
00000070 76 c0 18 90 ed 04 66 8e 8f 91 30 63 d2 e0 8c 1a |v.....f...0c....|
00000080 09 5c 7c ea 94 e3 24 15 60 |.\|...$.`|
00000020 69 63 65 2d 69 64 2d 71 37 00 00 00 00 57 42 30 |ice-id-q7....WB0|
00000030 31 00 00 00 02 00 00 00 17 68 a6 a2 24 00 66 00 |1........h..$.f.|
00000040 40 cc c9 4f 81 fd b0 4c 46 6d d7 bb aa 87 d8 e5 |@..O...LFm......|
00000050 84 54 b7 5b 58 22 d3 d1 53 d0 1d b8 6f 11 53 4f |.T.[X"..S...o.SO|
00000060 77 2b ef a8 bf d2 66 05 8e ce 7f 08 76 c0 18 90 |w+....f.....v...|
00000070 ed 04 66 8e 8f 91 30 63 d2 e0 8c 1a 09 5c 7c ea |..f...0c.....\|.|
00000080 94 e3 24 15 60 |..$.`|
# ---
# name: test_v1_device
[mqtt >]
Expand Down
26 changes: 5 additions & 21 deletions tests/e2e/test_device_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,24 +452,8 @@ async def test_q10_device(
(
{
**HOME_DATA_RAW,
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dictionary unpacking **HOME_DATA_RAW is duplicated on lines 454 and 457. This will cause the second unpacking to overwrite any keys from the first. Since both unpack the same dictionary, this is redundant. Remove the duplicate on line 457.

Suggested change
**HOME_DATA_RAW,

Copilot uses AI. Check for mistakes.
# Use a fake Q7 device and product profile as a placeholder
# until we add a json file based on the real one.
"devices": [
{
**mock_data.Q10_DEVICE_DATA,
"name": "Roborock Q7 XX",
"productId": "product-id-q7",
},
],
"products": [
{
**mock_data.SS07_PRODUCT_DATA,
"id": "product-id-q7",
"name": "Roborock Q7 Series",
"model": "roborock.vacuum.scXX",
"category": "robot.vacuum.cleaner",
},
],
"devices": [mock_data.Q7_DEVICE_DATA],
"products": [mock_data.SC01_PRODUCT_DATA],
}
)
],
Expand All @@ -486,7 +470,7 @@ async def test_q7_device(
# Prepare MQTT requests
response_builder = ResponseBuilder()
response_builder.version = B01_VERSION
test_topic = TEST_TOPIC_FORMAT.format(duid="device-id-def456")
test_topic = TEST_TOPIC_FORMAT.format(duid="device-id-q7")
mqtt_responses: list[bytes] = [
*MQTT_DEFAULT_RESPONSES,
# ACK the Query status call sent below. id is deterministic based on deterministic_message_fixtures
Expand All @@ -506,8 +490,8 @@ async def test_q7_device(
devices = await device_manager.get_devices()
assert len(devices) == 1
device = devices[0]
assert device.duid == "device-id-def456"
assert device.name == "Roborock Q7 XX"
assert device.duid == "device-id-q7"
assert device.name == "Roborock Q7"
assert device.is_connected
assert not device.is_local_connected # Q7 does not support local connections

Expand Down
2 changes: 2 additions & 0 deletions tests/mock_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,14 @@

# Products
A27_PRODUCT_DATA = PRODUCTS["home_data_product_a27.json"]
SC01_PRODUCT_DATA = PRODUCTS["home_data_product_sc01.json"]
SS07_PRODUCT_DATA = PRODUCTS["home_data_product_ss07.json"]
A102_PRODUCT_DATA = PRODUCTS["home_data_product_a102.json"]
A114_PRODUCT_DATA = PRODUCTS["home_data_product_a114.json"]

# Devices
S7_DEVICE_DATA = DEVICES["home_data_device_s7_maxv.json"]
Q7_DEVICE_DATA = DEVICES["home_data_device_q7.json"]
Q10_DEVICE_DATA = DEVICES["home_data_device_q10.json"]
ZEO_ONE_DEVICE_DATA = DEVICES["home_data_device_zeo_one.json"]
SAROS_10R_DEVICE_DATA = DEVICES["home_data_device_saros_10r.json"]
Expand Down
39 changes: 39 additions & 0 deletions tests/testdata/home_data_device_q7.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"duid": "device-id-q7",
"name": "Roborock Q7",
"localKey": "key123key123key1",
"productId": "q7_product_id",
"fv": "03.01.71",
"activeTime": 1749513705,
"timeZoneId": "Pacific/Auckland",
"iconUrl": "",
"share": true,
"shareTime": 1754789238,
"online": true,
"pv": "B01",
"tuyaMigrated": false,
"extra": "{\"1749518432\": \"0\", \"1753581557\": \"0\", \"clean_finish\": \"{}\"}",
"sn": "q7_sn",
"deviceStatus": {
"135": 0,
"120": 0,
"121": 8,
"122": 100,
"123": 4,
"124": 2,
"125": 77,
"126": 4294965348,
"127": 54,
"136": 1,
"137": 1,
"138": 0,
"139": 0,
"141": 0,
"142": 0
},
"silentOtaSwitch": false,
"f": false,
"createTime": 1749513706,
"cid": "DE",
"shareType": "UNLIMITED_TIME"
}
Loading