1
0
mirror of https://github.com/home-assistant/core.git synced 2026-05-08 17:49:37 +01:00

Update Liebherr to platinum (#167836)

This commit is contained in:
mettolen
2026-04-10 21:17:04 +03:00
committed by GitHub
parent e88022c2cc
commit c9ee533916
6 changed files with 23 additions and 9 deletions
+1
View File
@@ -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.*
@@ -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),
+5 -4
View File
@@ -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))
@@ -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": [
{
@@ -73,4 +73,4 @@ rules:
# Platinum
async-dependency: done
inject-websession: done
strict-typing: todo
strict-typing: done
Generated
+10
View File
@@ -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