diff --git a/homeassistant/components/vistapool/manifest.json b/homeassistant/components/vistapool/manifest.json index bcc37f4a014c..42a944c3defe 100644 --- a/homeassistant/components/vistapool/manifest.json +++ b/homeassistant/components/vistapool/manifest.json @@ -13,5 +13,5 @@ "iot_class": "cloud_push", "loggers": ["aioaquarite"], "quality_scale": "bronze", - "requirements": ["aioaquarite==0.9.0"] + "requirements": ["aioaquarite==0.9.2"] } diff --git a/requirements_all.txt b/requirements_all.txt index b287137d9842..9058c3549978 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -206,7 +206,7 @@ aioapcaccess==1.0.0 aioaquacell==1.0.0 # homeassistant.components.vistapool -aioaquarite==0.9.0 +aioaquarite==0.9.2 # homeassistant.components.aseko_pool_live aioaseko==1.0.0 diff --git a/tests/components/vistapool/test_select.py b/tests/components/vistapool/test_select.py index af800b81f052..c1872ca0f2d9 100644 --- a/tests/components/vistapool/test_select.py +++ b/tests/components/vistapool/test_select.py @@ -157,6 +157,42 @@ async def test_select_option_writes_index( ) +@pytest.mark.parametrize( + ("raw_value", "expected_option"), + [ + pytest.param(0, "slow", id="slow"), + pytest.param(1, "medium", id="medium"), + pytest.param(2, "high", id="high"), + ], +) +async def test_filtration_timer_speed_options( + hass: HomeAssistant, + mock_config_entry: MockConfigEntry, + mock_vistapool_client: AsyncMock, + raw_value: int, + expected_option: str, +) -> None: + """Test every timer speed maps onto its option. + + The timer speeds are three-state like the manual pump speed, so high + has to survive the library's value coercion; slow and medium would + still map correctly even if the value were read as a boolean. + """ + mock_vistapool_client.fetch_pool_data.return_value = { + "main": {"version": 1}, + "filtration": {"timerVel1": raw_value}, + } + mock_config_entry.add_to_hass(hass) + + assert await hass.config_entries.async_setup(mock_config_entry.entry_id) + await hass.async_block_till_done() + + assert ( + hass.states.get("select.my_pool_filtration_timer_speed_1").state + == expected_option + ) + + async def test_select_option_raises_on_api_error( hass: HomeAssistant, mock_config_entry: MockConfigEntry,