From c9ee533916bb9ed397adaf0fc08a0df35d58ec0d Mon Sep 17 00:00:00 2001 From: mettolen <1007649+mettolen@users.noreply.github.com> Date: Fri, 10 Apr 2026 21:17:04 +0300 Subject: [PATCH] Update Liebherr to platinum (#167836) --- .strict-typing | 1 + homeassistant/components/liebherr/config_flow.py | 8 +++++--- homeassistant/components/liebherr/light.py | 9 +++++---- homeassistant/components/liebherr/manifest.json | 2 +- homeassistant/components/liebherr/quality_scale.yaml | 2 +- mypy.ini | 10 ++++++++++ 6 files changed, 23 insertions(+), 9 deletions(-) diff --git a/.strict-typing b/.strict-typing index 5e154925661..695c7faa99d 100644 --- a/.strict-typing +++ b/.strict-typing @@ -332,6 +332,7 @@ homeassistant.components.letpot.* homeassistant.components.lg_infrared.* homeassistant.components.libre_hardware_monitor.* homeassistant.components.lidarr.* +homeassistant.components.liebherr.* homeassistant.components.lifx.* homeassistant.components.light.* homeassistant.components.linkplay.* diff --git a/homeassistant/components/liebherr/config_flow.py b/homeassistant/components/liebherr/config_flow.py index 8aa1f562893..5f0686f1113 100644 --- a/homeassistant/components/liebherr/config_flow.py +++ b/homeassistant/components/liebherr/config_flow.py @@ -6,7 +6,7 @@ from collections.abc import Mapping import logging from typing import Any -from pyliebherrhomeapi import LiebherrClient +from pyliebherrhomeapi import Device, LiebherrClient from pyliebherrhomeapi.exceptions import ( LiebherrAuthenticationError, LiebherrConnectionError, @@ -31,10 +31,12 @@ STEP_USER_DATA_SCHEMA = vol.Schema( class LiebherrConfigFlow(ConfigFlow, domain=DOMAIN): """Handle a config flow for liebherr.""" - async def _validate_api_key(self, api_key: str) -> tuple[list, dict[str, str]]: + async def _validate_api_key( + self, api_key: str + ) -> tuple[list[Device], dict[str, str]]: """Validate the API key and return devices and errors.""" errors: dict[str, str] = {} - devices: list = [] + devices: list[Device] = [] client = LiebherrClient( api_key=api_key, session=async_get_clientsession(self.hass), diff --git a/homeassistant/components/liebherr/light.py b/homeassistant/components/liebherr/light.py index f952e04c7aa..9665bf4822f 100644 --- a/homeassistant/components/liebherr/light.py +++ b/homeassistant/components/liebherr/light.py @@ -6,7 +6,10 @@ import math from typing import TYPE_CHECKING, Any from pyliebherrhomeapi import PresentationLightControl -from pyliebherrhomeapi.const import CONTROL_PRESENTATION_LIGHT +from pyliebherrhomeapi.const import ( + CONTROL_PRESENTATION_LIGHT, + DEFAULT_PRESENTATION_LIGHT_MAX_BRIGHTNESS, +) from homeassistant.components.light import ATTR_BRIGHTNESS, ColorMode, LightEntity from homeassistant.core import HomeAssistant, callback @@ -17,8 +20,6 @@ from .const import DOMAIN from .coordinator import LiebherrConfigEntry, LiebherrCoordinator from .entity import LiebherrEntity -DEFAULT_MAX_BRIGHTNESS_LEVEL = 5 - PARALLEL_UPDATES = 1 @@ -108,7 +109,7 @@ class LiebherrPresentationLight(LiebherrEntity, LightEntity): control = self._light_control if TYPE_CHECKING: assert control is not None - max_level = control.max or DEFAULT_MAX_BRIGHTNESS_LEVEL + max_level = control.max or DEFAULT_PRESENTATION_LIGHT_MAX_BRIGHTNESS if ATTR_BRIGHTNESS in kwargs: target = max(1, round(kwargs[ATTR_BRIGHTNESS] * max_level / 255)) diff --git a/homeassistant/components/liebherr/manifest.json b/homeassistant/components/liebherr/manifest.json index 9130562f3d8..97ae7558bd5 100644 --- a/homeassistant/components/liebherr/manifest.json +++ b/homeassistant/components/liebherr/manifest.json @@ -7,7 +7,7 @@ "integration_type": "hub", "iot_class": "cloud_polling", "loggers": ["pyliebherrhomeapi"], - "quality_scale": "gold", + "quality_scale": "platinum", "requirements": ["pyliebherrhomeapi==0.4.1"], "zeroconf": [ { diff --git a/homeassistant/components/liebherr/quality_scale.yaml b/homeassistant/components/liebherr/quality_scale.yaml index 712bedd1c2a..5639ae68962 100644 --- a/homeassistant/components/liebherr/quality_scale.yaml +++ b/homeassistant/components/liebherr/quality_scale.yaml @@ -73,4 +73,4 @@ rules: # Platinum async-dependency: done inject-websession: done - strict-typing: todo + strict-typing: done diff --git a/mypy.ini b/mypy.ini index 0ca25a2f94b..9ec8a76c218 100644 --- a/mypy.ini +++ b/mypy.ini @@ -3075,6 +3075,16 @@ disallow_untyped_defs = true warn_return_any = true warn_unreachable = true +[mypy-homeassistant.components.liebherr.*] +check_untyped_defs = true +disallow_incomplete_defs = true +disallow_subclassing_any = true +disallow_untyped_calls = true +disallow_untyped_decorators = true +disallow_untyped_defs = true +warn_return_any = true +warn_unreachable = true + [mypy-homeassistant.components.lifx.*] check_untyped_defs = true disallow_incomplete_defs = true