File tree Expand file tree Collapse file tree 2 files changed +2
-10
lines changed
roborock/devices/traits/a01 Expand file tree Collapse file tree 2 files changed +2
-10
lines changed Original file line number Diff line number Diff line change 7171}
7272
7373ZEO_PROTOCOL_ENTRIES : dict [RoborockZeoProtocol , Callable ] = {
74- # ro
74+ # read-only
7575 RoborockZeoProtocol .STATE : lambda val : ZeoState (val ).name ,
7676 RoborockZeoProtocol .COUNTDOWN : lambda val : int (val ),
7777 RoborockZeoProtocol .WASHING_LEFT : lambda val : int (val ),
7878 RoborockZeoProtocol .ERROR : lambda val : ZeoError (val ).name ,
7979 RoborockZeoProtocol .TIMES_AFTER_CLEAN : lambda val : int (val ),
8080 RoborockZeoProtocol .DETERGENT_EMPTY : lambda val : bool (val ),
8181 RoborockZeoProtocol .SOFTENER_EMPTY : lambda val : bool (val ),
82- # rw
82+ # read-write
8383 RoborockZeoProtocol .MODE : lambda val : ZeoMode (val ).name ,
8484 RoborockZeoProtocol .PROGRAM : lambda val : ZeoProgram (val ).name ,
8585 RoborockZeoProtocol .TEMP : lambda val : ZeoTemperature (val ).name ,
Original file line number Diff line number Diff line change @@ -12,19 +12,11 @@ def mock_channel():
1212 channel .send_command = AsyncMock ()
1313 # Mocking send_decoded_command if it was a method on channel, but it's a standalone function imported in traits.
1414 # However, in traits/__init__.py it is imported as: from roborock.devices.a01_channel import send_decoded_command
15- # Implementation detail: we need to mock send_decoded_command where it is used.
1615 return channel
1716
1817
19- @pytest .fixture
20- def mock_send_decoded_command ():
21- with patch ("roborock.devices.traits.a01.send_decoded_command" , new_callable = AsyncMock ) as mock :
22- yield mock
23-
24-
2518@pytest .mark .asyncio
2619async def test_dyad_query_values (mock_channel ):
27- # We need to patch send_decoded_command in the module under test
2820 with patch ("roborock.devices.traits.a01.send_decoded_command" , new_callable = AsyncMock ) as mock_send :
2921 api = DyadApi (mock_channel )
3022
You can’t perform that action at this time.
0 commit comments