Improve switch and climate type hints in integrations (#90040)

pull/90043/head
epenet 2023-03-21 13:26:41 +01:00 committed by GitHub
parent 9092a76dbf
commit 93efdc4991
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 3 deletions

View File

@ -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)

View File

@ -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:

View File

@ -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,