Skip to content

Commit a4f0a21

Browse files
authored
Bump aioamazondevices to 9.0.2 (home-assistant#156963)
1 parent 11a2b5d commit a4f0a21

File tree

7 files changed

+16
-13
lines changed

7 files changed

+16
-13
lines changed

homeassistant/components/alexa_devices/config_flow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ async def validate_input(hass: HomeAssistant, data: dict[str, Any]) -> dict[str,
4545
data[CONF_PASSWORD],
4646
)
4747

48-
return await api.login_mode_interactive(data[CONF_CODE])
48+
return await api.login.login_mode_interactive(data[CONF_CODE])
4949

5050

5151
class AmazonDevicesConfigFlow(ConfigFlow, domain=DOMAIN):

homeassistant/components/alexa_devices/coordinator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def __init__(
5959
async def _async_update_data(self) -> dict[str, AmazonDevice]:
6060
"""Update device data."""
6161
try:
62-
await self.api.login_mode_stored_data()
62+
await self.api.login.login_mode_stored_data()
6363
data = await self.api.get_devices_data()
6464
except CannotConnect as err:
6565
raise UpdateFailed(

homeassistant/components/alexa_devices/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
"iot_class": "cloud_polling",
99
"loggers": ["aioamazondevices"],
1010
"quality_scale": "platinum",
11-
"requirements": ["aioamazondevices==8.0.1"]
11+
"requirements": ["aioamazondevices==9.0.2"]
1212
}

requirements_all.txt

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

requirements_test_all.txt

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/components/alexa_devices/conftest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ def mock_amazon_devices_client() -> Generator[AsyncMock]:
4343
),
4444
):
4545
client = mock_client.return_value
46-
client.login_mode_interactive.return_value = {
46+
client.login = AsyncMock()
47+
client.login.login_mode_interactive.return_value = {
4748
"customer_info": {"user_id": TEST_USERNAME},
4849
CONF_SITE: "https://www.amazon.com",
4950
}

tests/components/alexa_devices/test_config_flow.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ async def test_full_flow(
5656
},
5757
}
5858
assert result["result"].unique_id == TEST_USERNAME
59-
mock_amazon_devices_client.login_mode_interactive.assert_called_once_with("023123")
59+
mock_amazon_devices_client.login.login_mode_interactive.assert_called_once_with(
60+
"023123"
61+
)
6062

6163

6264
@pytest.mark.parametrize(
@@ -75,7 +77,7 @@ async def test_flow_errors(
7577
error: str,
7678
) -> None:
7779
"""Test flow errors."""
78-
mock_amazon_devices_client.login_mode_interactive.side_effect = exception
80+
mock_amazon_devices_client.login.login_mode_interactive.side_effect = exception
7981

8082
result = await hass.config_entries.flow.async_init(
8183
DOMAIN,
@@ -97,7 +99,7 @@ async def test_flow_errors(
9799
assert result["type"] is FlowResultType.FORM
98100
assert result["errors"] == {"base": error}
99101

100-
mock_amazon_devices_client.login_mode_interactive.side_effect = None
102+
mock_amazon_devices_client.login.login_mode_interactive.side_effect = None
101103

102104
result = await hass.config_entries.flow.async_configure(
103105
result["flow_id"],
@@ -196,7 +198,7 @@ async def test_reauth_not_successful(
196198
assert result["type"] is FlowResultType.FORM
197199
assert result["step_id"] == "reauth_confirm"
198200

199-
mock_amazon_devices_client.login_mode_interactive.side_effect = side_effect
201+
mock_amazon_devices_client.login.login_mode_interactive.side_effect = side_effect
200202
result = await hass.config_entries.flow.async_configure(
201203
result["flow_id"],
202204
user_input={
@@ -209,7 +211,7 @@ async def test_reauth_not_successful(
209211
assert result["step_id"] == "reauth_confirm"
210212
assert result["errors"] == {"base": error}
211213

212-
mock_amazon_devices_client.login_mode_interactive.side_effect = None
214+
mock_amazon_devices_client.login.login_mode_interactive.side_effect = None
213215

214216
result = await hass.config_entries.flow.async_configure(
215217
result["flow_id"],
@@ -295,7 +297,7 @@ async def test_reconfigure_fails(
295297
assert result["type"] is FlowResultType.FORM
296298
assert result["step_id"] == "reconfigure"
297299

298-
mock_amazon_devices_client.login_mode_interactive.side_effect = side_effect
300+
mock_amazon_devices_client.login.login_mode_interactive.side_effect = side_effect
299301

300302
reconfigure_result = await hass.config_entries.flow.async_configure(
301303
result["flow_id"],
@@ -309,7 +311,7 @@ async def test_reconfigure_fails(
309311
assert reconfigure_result["step_id"] == "reconfigure"
310312
assert reconfigure_result["errors"] == {"base": error}
311313

312-
mock_amazon_devices_client.login_mode_interactive.side_effect = None
314+
mock_amazon_devices_client.login.login_mode_interactive.side_effect = None
313315

314316
reconfigure_result = await hass.config_entries.flow.async_configure(
315317
result["flow_id"],

0 commit comments

Comments
 (0)