Skip to content

Commit 7b26533

Browse files
committed
feat(a01): add push listener for unsolicited device state
1 parent 862be93 commit 7b26533

2 files changed

Lines changed: 1 addition & 5 deletions

File tree

roborock/devices/traits/a01/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,6 @@ def convert_zeo_value(protocol_value: RoborockZeoProtocol, value: Any) -> Any:
138138
return None
139139

140140

141-
# RoborockDyadDataProtocol._missing_ maps any unknown code to its first member
142-
# instead of raising, so incoming data points must be checked against this set
143-
# before being converted to a protocol.
144141
_DYAD_PROTOCOL_VALUES = frozenset(protocol.value for protocol in RoborockDyadDataProtocol)
145142

146143

tests/devices/traits/a01/test_init.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ async def test_dyad_add_listener(dyad_api: DyadApi, fake_channel: FakeChannel):
141141
received: list[dict[RoborockDyadDataProtocol, Any]] = []
142142
unsub = await dyad_api.add_listener(received.append)
143143

144-
# 999 is not a known protocol: it must be skipped, not mapped to the first enum member.
145144
fake_channel.notify_subscribers(build_a01_message({206: 3, 209: 80, 216: 0, 999: 1}))
146145

147146
assert received == [
@@ -154,7 +153,7 @@ async def test_dyad_add_listener(dyad_api: DyadApi, fake_channel: FakeChannel):
154153

155154
unsub()
156155
fake_channel.notify_subscribers(build_a01_message({206: 1}))
157-
assert len(received) == 1 # no callback fires after unsubscribing
156+
assert len(received) == 1
158157

159158

160159
async def test_zeo_api_query_values(zeo_api: ZeoApi, fake_channel: FakeChannel):

0 commit comments

Comments
 (0)