|
25 | 25 | BluetoothMachineCapabilities, |
26 | 26 | CoffeeBoiler, |
27 | 27 | MachineStatus, |
| 28 | + NoWater, |
28 | 29 | SteamBoilerLevel, |
29 | 30 | SteamBoilerTemperature, |
30 | 31 | ) |
@@ -131,13 +132,15 @@ async def test_get_dashboard_from_bluetooth( |
131 | 132 | ), |
132 | 133 | ] |
133 | 134 | ) |
| 135 | + mock_bluetooth_client.get_tank_status = AsyncMock(return_value=True) |
134 | 136 |
|
135 | 137 | await mock_machine_with_dashboard.get_dashboard_from_bluetooth() |
136 | 138 |
|
137 | 139 | # Verify calls - capabilities should NOT be called automatically anymore |
138 | 140 | mock_bluetooth_client.get_machine_capabilities.assert_not_called() |
139 | 141 | mock_bluetooth_client.get_machine_mode.assert_called_once() |
140 | 142 | mock_bluetooth_client.get_boilers.assert_called_once() |
| 143 | + mock_bluetooth_client.get_tank_status.assert_called_once() |
141 | 144 |
|
142 | 145 | # Snapshot test includes model_name, model_code, and config |
143 | 146 | assert mock_machine_with_dashboard.dashboard.to_dict() == snapshot |
@@ -169,6 +172,13 @@ async def test_get_dashboard_from_bluetooth( |
169 | 172 | not in mock_machine_with_dashboard.dashboard.config |
170 | 173 | ) |
171 | 174 |
|
| 175 | + # Verify tank status widget |
| 176 | + no_water = cast( |
| 177 | + NoWater, |
| 178 | + mock_machine_with_dashboard.dashboard.config[WidgetType.CM_NO_WATER], |
| 179 | + ) |
| 180 | + assert no_water.allarm is False # Tank status is True, so allarm should be False |
| 181 | + |
172 | 182 |
|
173 | 183 | async def test_get_dashboard_no_bluetooth( |
174 | 184 | mock_machine_with_dashboard: LaMarzoccoMachine, |
@@ -251,6 +261,7 @@ async def test_get_dashboard_initializes_missing_widgets( |
251 | 261 | ), |
252 | 262 | ] |
253 | 263 | ) |
| 264 | + mock_bluetooth_client.get_tank_status = AsyncMock(return_value=True) |
254 | 265 |
|
255 | 266 | # First fetch model info explicitly |
256 | 267 | await mock_machine_with_dashboard.get_model_info_from_bluetooth() |
@@ -317,6 +328,7 @@ async def test_get_dashboard_without_steam_level_support( |
317 | 328 | ), |
318 | 329 | ] |
319 | 330 | ) |
| 331 | + mock_bluetooth_client.get_tank_status = AsyncMock(return_value=True) |
320 | 332 |
|
321 | 333 | # First fetch model info explicitly |
322 | 334 | await mock_machine_with_dashboard.get_model_info_from_bluetooth() |
@@ -391,6 +403,7 @@ async def test_get_dashboard_mini_original_temperature_only( |
391 | 403 | ), |
392 | 404 | ] |
393 | 405 | ) |
| 406 | + mock_bluetooth_client.get_tank_status = AsyncMock(return_value=True) |
394 | 407 |
|
395 | 408 | # First fetch model info explicitly |
396 | 409 | await mock_machine_with_dashboard.get_model_info_from_bluetooth() |
|
0 commit comments