From 93efdc499131c6d9b0bb34bb31fd82dfbd541829 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Tue, 21 Mar 2023 13:26:41 +0100 Subject: [PATCH] Improve switch and climate type hints in integrations (#90040) --- homeassistant/components/bsblan/climate.py | 2 +- homeassistant/components/rachio/switch.py | 2 +- homeassistant/components/switchbot/switch.py | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/bsblan/climate.py b/homeassistant/components/bsblan/climate.py index fcff6a925e5..cbc6dd00471 100644 --- a/homeassistant/components/bsblan/climate.py +++ b/homeassistant/components/bsblan/climate.py @@ -129,7 +129,7 @@ class BSBLANClimate( return PRESET_ECO return PRESET_NONE - async def async_set_hvac_mode(self, hvac_mode: str) -> None: + async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None: """Set hvac mode.""" await self.async_set_data(hvac_mode=hvac_mode) diff --git a/homeassistant/components/rachio/switch.py b/homeassistant/components/rachio/switch.py index bc27c0b2203..85abb989b64 100644 --- a/homeassistant/components/rachio/switch.py +++ b/homeassistant/components/rachio/switch.py @@ -399,7 +399,7 @@ class RachioZone(RachioSwitch): return self._entity_picture @property - def extra_state_attributes(self) -> dict: + def extra_state_attributes(self) -> dict[str, Any]: """Return the optional state attributes.""" props = {ATTR_ZONE_NUMBER: self._zone_number, ATTR_ZONE_SUMMARY: self._summary} if self._shade_type: diff --git a/homeassistant/components/switchbot/switch.py b/homeassistant/components/switchbot/switch.py index 76214a4412f..befbf00f8be 100644 --- a/homeassistant/components/switchbot/switch.py +++ b/homeassistant/components/switchbot/switch.py @@ -2,6 +2,7 @@ from __future__ import annotations import logging +from typing import Any import switchbot @@ -61,7 +62,7 @@ class SwitchBotSwitch(SwitchbotSwitchedEntity, SwitchEntity, RestoreEntity): return self._device.is_on() @property - def extra_state_attributes(self) -> dict: + def extra_state_attributes(self) -> dict[str, Any]: """Return the state attributes.""" return { **super().extra_state_attributes,