From 69c2215121be6bf7f6819235954f39ae91be511d Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Fri, 18 Sep 2026 16:48:52 +0200 Subject: [PATCH] Import probatio directly instead of aliasing it as vol (#182595) Co-authored-by: Claude Co-authored-by: epenet <6771947+epenet@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .../components/de_dietrich/config_flow.py | 14 +++++++------- pyproject.toml | 4 ++++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/de_dietrich/config_flow.py b/homeassistant/components/de_dietrich/config_flow.py index 707c52f299c7..71a5728f687e 100644 --- a/homeassistant/components/de_dietrich/config_flow.py +++ b/homeassistant/components/de_dietrich/config_flow.py @@ -5,7 +5,7 @@ from typing import Any, override import diematic_modbus from modbus_connection import ModbusError, ModbusTcpParams -import probatio as vol +import probatio from homeassistant.components.modbus import async_get_temporary_unit from homeassistant.config_entries import ConfigFlow, ConfigFlowResult @@ -31,20 +31,20 @@ from .const import ( _LOGGER = logging.getLogger(__name__) -STEP_USER_DATA_SCHEMA = vol.Schema( +STEP_USER_DATA_SCHEMA = probatio.Schema( { - vol.Required(CONF_HOST): TextSelector(), - vol.Required(CONF_PORT, default=DEFAULT_PORT): vol.All( + probatio.Required(CONF_HOST): TextSelector(), + probatio.Required(CONF_PORT, default=DEFAULT_PORT): probatio.All( NumberSelector( NumberSelectorConfig(mode=NumberSelectorMode.BOX, min=1, max=65535) ), - vol.Coerce(int), + probatio.Coerce(int), ), - vol.Required(CONF_UNIT_ID, default=DEFAULT_UNIT_ID): vol.All( + probatio.Required(CONF_UNIT_ID, default=DEFAULT_UNIT_ID): probatio.All( NumberSelector( NumberSelectorConfig(mode=NumberSelectorMode.BOX, min=1, max=247) ), - vol.Coerce(int), + probatio.Coerce(int), ), } ) diff --git a/pyproject.toml b/pyproject.toml index 58bd0f6e2739..e27f93d1c103 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -662,6 +662,7 @@ select = [ "INP", # flake8-no-pep420 "ISC", # flake8-implicit-str-concat "ICN001", # import concentions; {name} should be imported as {asname} + "ICN002", # import conventions; {name} should not be imported as {asname} "LOG", # flake8-logging "N804", # First argument of a class method should be named cls "N805", # First argument of a method should be named self @@ -840,6 +841,9 @@ ignore = [ "homeassistant.util.uuid" = "uuid_util" "homeassistant.util.yaml" = "yaml_util" +[tool.ruff.lint.flake8-import-conventions.banned-aliases] +"probatio" = ["vol"] + [tool.ruff.lint.flake8-pytest-style] fixture-parentheses = false mark-parentheses = false