|
5 | 5 | import pytest |
6 | 6 |
|
7 | 7 | from roborock.data import RoborockDockTypeCode |
| 8 | +from roborock.device_features import RoborockDockFeatures |
8 | 9 | from roborock.devices.device import RoborockDevice |
9 | 10 | from roborock.devices.traits.v1.mop_dryer import MopDryerTrait |
10 | 11 | from roborock.roborock_typing import RoborockCommand |
@@ -164,3 +165,26 @@ async def test_dry_cycle( |
164 | 165 | mock_rpc_channel.send_command.assert_called_with( |
165 | 166 | RoborockCommand.APP_SET_DRYER_STATUS, params={"status": expected_status} |
166 | 167 | ) |
| 168 | + |
| 169 | + |
| 170 | +@pytest.mark.parametrize( |
| 171 | + ("supports_drying", "expected"), |
| 172 | + [ |
| 173 | + pytest.param(None, False, id="feature_not_reported"), |
| 174 | + pytest.param(False, False, id="feature_absent"), |
| 175 | + pytest.param(True, True, id="optional_dryer_module"), |
| 176 | + ], |
| 177 | +) |
| 178 | +def test_trait_gate_with_optional_dryer_module(supports_drying: bool | None, expected: bool) -> None: |
| 179 | + """The o3 dock is dryable when the device advertises drying support. |
| 180 | +
|
| 181 | + The o3 Empty Wash Fill dock is collect+wash only, so drying requires the |
| 182 | + optional dryer module (e.g. HADM02RR). The device reports that through the |
| 183 | + ``is_supported_drying`` device feature instead of the dock type. |
| 184 | + """ |
| 185 | + dock_features = RoborockDockFeatures.from_dock_type( |
| 186 | + RoborockDockTypeCode.o3_dock, |
| 187 | + supports_drying=supports_drying, |
| 188 | + ) |
| 189 | + |
| 190 | + assert MopDryerTrait.requires_dock_features(dock_features) is expected |
0 commit comments