From 56e638e1702f03963903301191cb97561daa8bd6 Mon Sep 17 00:00:00 2001 From: Kevin Stillhammer Date: Tue, 13 Jan 2026 10:18:15 +0100 Subject: [PATCH] accept leading zeros in sms_code for fressnapf_tracker (#160834) --- .../fressnapf_tracker/config_flow.py | 4 ++-- .../components/fressnapf_tracker/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- .../fressnapf_tracker/test_config_flow.py | 18 +++++++++--------- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/homeassistant/components/fressnapf_tracker/config_flow.py b/homeassistant/components/fressnapf_tracker/config_flow.py index 3823246308e..50531fe4624 100644 --- a/homeassistant/components/fressnapf_tracker/config_flow.py +++ b/homeassistant/components/fressnapf_tracker/config_flow.py @@ -31,7 +31,7 @@ STEP_USER_DATA_SCHEMA = vol.Schema( ) STEP_SMS_CODE_DATA_SCHEMA = vol.Schema( { - vol.Required(CONF_SMS_CODE): int, + vol.Required(CONF_SMS_CODE): str, } ) @@ -75,7 +75,7 @@ class FressnapfTrackerConfigFlow(ConfigFlow, domain=DOMAIN): return errors, False async def _async_verify_sms_code( - self, sms_code: int + self, sms_code: str ) -> tuple[dict[str, str], str | None]: """Verify SMS code and return errors and access_token.""" errors: dict[str, str] = {} diff --git a/homeassistant/components/fressnapf_tracker/manifest.json b/homeassistant/components/fressnapf_tracker/manifest.json index 4e493db07e9..482db2aedb0 100644 --- a/homeassistant/components/fressnapf_tracker/manifest.json +++ b/homeassistant/components/fressnapf_tracker/manifest.json @@ -7,5 +7,5 @@ "integration_type": "hub", "iot_class": "cloud_polling", "quality_scale": "bronze", - "requirements": ["fressnapftracker==0.2.0"] + "requirements": ["fressnapftracker==0.2.1"] } diff --git a/requirements_all.txt b/requirements_all.txt index 13578b065d8..d127909d346 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1011,7 +1011,7 @@ freebox-api==1.2.2 freesms==0.2.0 # homeassistant.components.fressnapf_tracker -fressnapftracker==0.2.0 +fressnapftracker==0.2.1 # homeassistant.components.fritz # homeassistant.components.fritzbox_callmonitor diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 3694f071407..b23ddac1f46 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -890,7 +890,7 @@ forecast-solar==4.2.0 freebox-api==1.2.2 # homeassistant.components.fressnapf_tracker -fressnapftracker==0.2.0 +fressnapftracker==0.2.1 # homeassistant.components.fritz # homeassistant.components.fritzbox_callmonitor diff --git a/tests/components/fressnapf_tracker/test_config_flow.py b/tests/components/fressnapf_tracker/test_config_flow.py index 295476ba6e9..d789a889f38 100644 --- a/tests/components/fressnapf_tracker/test_config_flow.py +++ b/tests/components/fressnapf_tracker/test_config_flow.py @@ -50,7 +50,7 @@ async def test_user_flow_success( # Submit SMS code result = await hass.config_entries.flow.async_configure( result["flow_id"], - {CONF_SMS_CODE: 123456}, + {CONF_SMS_CODE: "0123456"}, ) assert result["type"] is FlowResultType.CREATE_ENTRY @@ -107,7 +107,7 @@ async def test_user_flow_request_sms_code_errors( result = await hass.config_entries.flow.async_configure( result["flow_id"], - {CONF_SMS_CODE: 123456}, + {CONF_SMS_CODE: "0123456"}, ) assert result["type"] is FlowResultType.CREATE_ENTRY @@ -142,7 +142,7 @@ async def test_user_flow_verify_phone_number_errors( result = await hass.config_entries.flow.async_configure( result["flow_id"], - {CONF_SMS_CODE: 999999}, + {CONF_SMS_CODE: "999999"}, ) assert result["type"] is FlowResultType.FORM @@ -153,7 +153,7 @@ async def test_user_flow_verify_phone_number_errors( mock_auth_client.verify_phone_number.side_effect = None result = await hass.config_entries.flow.async_configure( result["flow_id"], - {CONF_SMS_CODE: 123456}, + {CONF_SMS_CODE: "0123456"}, ) assert result["type"] is FlowResultType.CREATE_ENTRY @@ -246,7 +246,7 @@ async def test_reauth_reconfigure_flow( # Submit SMS code result = await hass.config_entries.flow.async_configure( result["flow_id"], - {CONF_SMS_CODE: 123456}, + {CONF_SMS_CODE: "0123456"}, ) assert result["type"] is FlowResultType.ABORT @@ -311,7 +311,7 @@ async def test_reauth_reconfigure_flow_invalid_phone_number( result = await hass.config_entries.flow.async_configure( result["flow_id"], - {CONF_SMS_CODE: 123456}, + {CONF_SMS_CODE: "0123456"}, ) assert result["type"] is FlowResultType.ABORT @@ -358,7 +358,7 @@ async def test_reauth_reconfigure_flow_invalid_sms_code( result = await hass.config_entries.flow.async_configure( result["flow_id"], - {CONF_SMS_CODE: 999999}, + {CONF_SMS_CODE: "999999"}, ) assert result["type"] is FlowResultType.FORM @@ -369,7 +369,7 @@ async def test_reauth_reconfigure_flow_invalid_sms_code( mock_auth_client.verify_phone_number.side_effect = None result = await hass.config_entries.flow.async_configure( result["flow_id"], - {CONF_SMS_CODE: 123456}, + {CONF_SMS_CODE: "0123456"}, ) assert result["type"] is FlowResultType.ABORT @@ -436,7 +436,7 @@ async def test_reauth_reconfigure_flow_invalid_user_id( result = await hass.config_entries.flow.async_configure( result["flow_id"], - {CONF_SMS_CODE: 123456}, + {CONF_SMS_CODE: "0123456"}, ) assert result["type"] is FlowResultType.ABORT