From f07cf76f3138fbf4803d4625d427c67a629e4dbb Mon Sep 17 00:00:00 2001 From: Nailik <13292441+Nailik@users.noreply.github.com> Date: Sat, 17 Oct 2026 22:34:03 +0200 Subject: [PATCH] Add CONFIG_SCHEMA, drop the bleak requirement and the removed UP038 rule hassfest requires a CONFIG_SCHEMA on integrations that define async_setup. The integration is set up through config entries only, so use config_entry_only_config_schema. bleak is pinned by Home Assistant and provided by the bluetooth integration this one already depends on. Requiring bleak>=0.21.1 only risks a conflict with that pin. ruff removed UP038, so ignoring it only produced a warning on every run. Co-Authored-By: Claude Opus 5.5 --- custom_components/blanco_unit/__init__.py | 4 ++++ custom_components/blanco_unit/manifest.json | 2 +- pyproject.toml | 2 -- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/custom_components/blanco_unit/__init__.py b/custom_components/blanco_unit/__init__.py index 3d5ce10..7308482 100644 --- a/custom_components/blanco_unit/__init__.py +++ b/custom_components/blanco_unit/__init__.py @@ -24,6 +24,7 @@ ConfigEntryNotReady, IntegrationError, ) +from homeassistant.helpers import config_validation as cv from .client import validate_pin from .const import ( @@ -53,6 +54,9 @@ type BlancoUnitConfigEntry = ConfigEntry[BlancoUnitCoordinator] +# set up through config entries only, async_setup only registers the services +CONFIG_SCHEMA = cv.config_entry_only_config_schema(DOMAIN) + async def async_setup(hass: HomeAssistant, entry: BlancoUnitConfigEntry) -> bool: """Set up Blanco Unit integration services.""" diff --git a/custom_components/blanco_unit/manifest.json b/custom_components/blanco_unit/manifest.json index 8c405d8..6f45cb9 100644 --- a/custom_components/blanco_unit/manifest.json +++ b/custom_components/blanco_unit/manifest.json @@ -13,6 +13,6 @@ "integration_type": "device", "iot_class": "local_polling", "issue_tracker": "https://github.com/Nailik/blanco_unit/issues", - "requirements": ["bleak>=0.21.1"], + "requirements": [], "version": "0.0.13" } diff --git a/pyproject.toml b/pyproject.toml index e9b759a..a70ede0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -141,8 +141,6 @@ ignore = [ "TRY003", # Avoid specifying long messages outside the exception class "TRY400", # Use `logging.exception` instead of `logging.error` - # Ignored due to performance: https://github.com/charliermarsh/ruff/issues/2923 - "UP038", # Use `X | Y` in `isinstance` call instead of `(X, Y)` "UP046", # Non PEP 695 generic class "UP047", # Non PEP 696 generic function "UP049", # Avoid private type parameter names