diff --git a/homeassistant/components/alexa_devices/config_flow.py b/homeassistant/components/alexa_devices/config_flow.py index e863f137f70..cc7cdc3eb07 100644 --- a/homeassistant/components/alexa_devices/config_flow.py +++ b/homeassistant/components/alexa_devices/config_flow.py @@ -45,7 +45,7 @@ async def validate_input(hass: HomeAssistant, data: dict[str, Any]) -> dict[str, data[CONF_PASSWORD], ) - return await api.login_mode_interactive(data[CONF_CODE]) + return await api.login.login_mode_interactive(data[CONF_CODE]) class AmazonDevicesConfigFlow(ConfigFlow, domain=DOMAIN): diff --git a/homeassistant/components/alexa_devices/coordinator.py b/homeassistant/components/alexa_devices/coordinator.py index 4d1b37c9d1a..b7d87ce716b 100644 --- a/homeassistant/components/alexa_devices/coordinator.py +++ b/homeassistant/components/alexa_devices/coordinator.py @@ -59,7 +59,7 @@ class AmazonDevicesCoordinator(DataUpdateCoordinator[dict[str, AmazonDevice]]): async def _async_update_data(self) -> dict[str, AmazonDevice]: """Update device data.""" try: - await self.api.login_mode_stored_data() + await self.api.login.login_mode_stored_data() data = await self.api.get_devices_data() except CannotConnect as err: raise UpdateFailed( diff --git a/homeassistant/components/alexa_devices/manifest.json b/homeassistant/components/alexa_devices/manifest.json index 155acf5b81a..9ff45a6ce96 100644 --- a/homeassistant/components/alexa_devices/manifest.json +++ b/homeassistant/components/alexa_devices/manifest.json @@ -8,5 +8,5 @@ "iot_class": "cloud_polling", "loggers": ["aioamazondevices"], "quality_scale": "platinum", - "requirements": ["aioamazondevices==8.0.1"] + "requirements": ["aioamazondevices==9.0.2"] } diff --git a/requirements_all.txt b/requirements_all.txt index 19a197f4ecb..ef508664c36 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -190,7 +190,7 @@ aioairzone-cloud==0.7.2 aioairzone==1.0.2 # homeassistant.components.alexa_devices -aioamazondevices==8.0.1 +aioamazondevices==9.0.2 # homeassistant.components.ambient_network # homeassistant.components.ambient_station diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 22bc530267a..e3adf4c86d2 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -178,7 +178,7 @@ aioairzone-cloud==0.7.2 aioairzone==1.0.2 # homeassistant.components.alexa_devices -aioamazondevices==8.0.1 +aioamazondevices==9.0.2 # homeassistant.components.ambient_network # homeassistant.components.ambient_station diff --git a/tests/components/alexa_devices/conftest.py b/tests/components/alexa_devices/conftest.py index 99b9654e24b..cc0d045b3d2 100644 --- a/tests/components/alexa_devices/conftest.py +++ b/tests/components/alexa_devices/conftest.py @@ -43,7 +43,8 @@ def mock_amazon_devices_client() -> Generator[AsyncMock]: ), ): client = mock_client.return_value - client.login_mode_interactive.return_value = { + client.login = AsyncMock() + client.login.login_mode_interactive.return_value = { "customer_info": {"user_id": TEST_USERNAME}, CONF_SITE: "https://www.amazon.com", } diff --git a/tests/components/alexa_devices/test_config_flow.py b/tests/components/alexa_devices/test_config_flow.py index 4722f9c0c5f..1368b357610 100644 --- a/tests/components/alexa_devices/test_config_flow.py +++ b/tests/components/alexa_devices/test_config_flow.py @@ -56,7 +56,9 @@ async def test_full_flow( }, } assert result["result"].unique_id == TEST_USERNAME - mock_amazon_devices_client.login_mode_interactive.assert_called_once_with("023123") + mock_amazon_devices_client.login.login_mode_interactive.assert_called_once_with( + "023123" + ) @pytest.mark.parametrize( @@ -75,7 +77,7 @@ async def test_flow_errors( error: str, ) -> None: """Test flow errors.""" - mock_amazon_devices_client.login_mode_interactive.side_effect = exception + mock_amazon_devices_client.login.login_mode_interactive.side_effect = exception result = await hass.config_entries.flow.async_init( DOMAIN, @@ -97,7 +99,7 @@ async def test_flow_errors( assert result["type"] is FlowResultType.FORM assert result["errors"] == {"base": error} - mock_amazon_devices_client.login_mode_interactive.side_effect = None + mock_amazon_devices_client.login.login_mode_interactive.side_effect = None result = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -196,7 +198,7 @@ async def test_reauth_not_successful( assert result["type"] is FlowResultType.FORM assert result["step_id"] == "reauth_confirm" - mock_amazon_devices_client.login_mode_interactive.side_effect = side_effect + mock_amazon_devices_client.login.login_mode_interactive.side_effect = side_effect result = await hass.config_entries.flow.async_configure( result["flow_id"], user_input={ @@ -209,7 +211,7 @@ async def test_reauth_not_successful( assert result["step_id"] == "reauth_confirm" assert result["errors"] == {"base": error} - mock_amazon_devices_client.login_mode_interactive.side_effect = None + mock_amazon_devices_client.login.login_mode_interactive.side_effect = None result = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -295,7 +297,7 @@ async def test_reconfigure_fails( assert result["type"] is FlowResultType.FORM assert result["step_id"] == "reconfigure" - mock_amazon_devices_client.login_mode_interactive.side_effect = side_effect + mock_amazon_devices_client.login.login_mode_interactive.side_effect = side_effect reconfigure_result = await hass.config_entries.flow.async_configure( result["flow_id"], @@ -309,7 +311,7 @@ async def test_reconfigure_fails( assert reconfigure_result["step_id"] == "reconfigure" assert reconfigure_result["errors"] == {"base": error} - mock_amazon_devices_client.login_mode_interactive.side_effect = None + mock_amazon_devices_client.login.login_mode_interactive.side_effect = None reconfigure_result = await hass.config_entries.flow.async_configure( result["flow_id"],