From 61e6882b91d4d1dc40fcfdc017b6842464cfe3bd Mon Sep 17 00:00:00 2001 From: Robert Resch Date: Fri, 2 Feb 2024 11:02:00 +0100 Subject: [PATCH] Bump deebot_client to 5.1.0 (#109360) --- homeassistant/components/ecovacs/config_flow.py | 6 +++++- homeassistant/components/ecovacs/controller.py | 2 +- homeassistant/components/ecovacs/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- tests/components/ecovacs/test_init.py | 1 + 6 files changed, 10 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/ecovacs/config_flow.py b/homeassistant/components/ecovacs/config_flow.py index 39c61b3ce23..db3c60fa9e7 100644 --- a/homeassistant/components/ecovacs/config_flow.py +++ b/homeassistant/components/ecovacs/config_flow.py @@ -75,7 +75,7 @@ async def _validate_input( rest_config = create_rest_config( aiohttp_client.async_get_clientsession(hass), device_id=device_id, - country=country, + alpha_2_country=country, override_rest_url=rest_url, ) @@ -266,6 +266,10 @@ class EcovacsConfigFlow(ConfigFlow, domain=DOMAIN): # If not we will inform the user about the mismatch. error = None placeholders = None + + # Convert the country to upper case as ISO 3166-1 alpha-2 country codes are upper case + user_input[CONF_COUNTRY] = user_input[CONF_COUNTRY].upper() + if len(user_input[CONF_COUNTRY]) != 2: error = "invalid_country_length" placeholders = {"countries_url": "https://www.iso.org/obp/ui/#search/code/"} diff --git a/homeassistant/components/ecovacs/controller.py b/homeassistant/components/ecovacs/controller.py index 27a1996c3e9..27b64db20b6 100644 --- a/homeassistant/components/ecovacs/controller.py +++ b/homeassistant/components/ecovacs/controller.py @@ -49,7 +49,7 @@ class EcovacsController: create_rest_config( aiohttp_client.async_get_clientsession(self._hass), device_id=self._device_id, - country=country, + alpha_2_country=country, override_rest_url=config.get(CONF_OVERRIDE_REST_URL), ), config[CONF_USERNAME], diff --git a/homeassistant/components/ecovacs/manifest.json b/homeassistant/components/ecovacs/manifest.json index 3472e4746f8..34760ea6aca 100644 --- a/homeassistant/components/ecovacs/manifest.json +++ b/homeassistant/components/ecovacs/manifest.json @@ -6,5 +6,5 @@ "documentation": "https://www.home-assistant.io/integrations/ecovacs", "iot_class": "cloud_push", "loggers": ["sleekxmppfs", "sucks", "deebot_client"], - "requirements": ["py-sucks==0.9.8", "deebot-client==5.0.0"] + "requirements": ["py-sucks==0.9.8", "deebot-client==5.1.0"] } diff --git a/requirements_all.txt b/requirements_all.txt index 2b804e3720a..4aa0c0e08d6 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -684,7 +684,7 @@ debugpy==1.8.0 # decora==0.6 # homeassistant.components.ecovacs -deebot-client==5.0.0 +deebot-client==5.1.0 # homeassistant.components.ihc # homeassistant.components.namecheapdns diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 10c89637f25..8c0889cdf01 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -559,7 +559,7 @@ dbus-fast==2.21.1 debugpy==1.8.0 # homeassistant.components.ecovacs -deebot-client==5.0.0 +deebot-client==5.1.0 # homeassistant.components.ihc # homeassistant.components.namecheapdns diff --git a/tests/components/ecovacs/test_init.py b/tests/components/ecovacs/test_init.py index 8557ccb983c..e76001fbaeb 100644 --- a/tests/components/ecovacs/test_init.py +++ b/tests/components/ecovacs/test_init.py @@ -80,6 +80,7 @@ async def test_invalid_auth( ({}, 0), ({DOMAIN: IMPORT_DATA.copy()}, 1), ], + ids=["no_config", "import_config"], ) async def test_async_setup_import( hass: HomeAssistant,