mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Improve switch and climate type hints in integrations (#90040)
This commit is contained in:
parent
9092a76dbf
commit
93efdc4991
@ -129,7 +129,7 @@ class BSBLANClimate(
|
|||||||
return PRESET_ECO
|
return PRESET_ECO
|
||||||
return PRESET_NONE
|
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."""
|
"""Set hvac mode."""
|
||||||
await self.async_set_data(hvac_mode=hvac_mode)
|
await self.async_set_data(hvac_mode=hvac_mode)
|
||||||
|
|
||||||
|
@ -399,7 +399,7 @@ class RachioZone(RachioSwitch):
|
|||||||
return self._entity_picture
|
return self._entity_picture
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def extra_state_attributes(self) -> dict:
|
def extra_state_attributes(self) -> dict[str, Any]:
|
||||||
"""Return the optional state attributes."""
|
"""Return the optional state attributes."""
|
||||||
props = {ATTR_ZONE_NUMBER: self._zone_number, ATTR_ZONE_SUMMARY: self._summary}
|
props = {ATTR_ZONE_NUMBER: self._zone_number, ATTR_ZONE_SUMMARY: self._summary}
|
||||||
if self._shade_type:
|
if self._shade_type:
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
from typing import Any
|
||||||
|
|
||||||
import switchbot
|
import switchbot
|
||||||
|
|
||||||
@ -61,7 +62,7 @@ class SwitchBotSwitch(SwitchbotSwitchedEntity, SwitchEntity, RestoreEntity):
|
|||||||
return self._device.is_on()
|
return self._device.is_on()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def extra_state_attributes(self) -> dict:
|
def extra_state_attributes(self) -> dict[str, Any]:
|
||||||
"""Return the state attributes."""
|
"""Return the state attributes."""
|
||||||
return {
|
return {
|
||||||
**super().extra_state_attributes,
|
**super().extra_state_attributes,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user