mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
Remove somfy from mypy ignore list (#64462)
* Adjust somfy * Remove somfy from mypy-config * Fix pylint
This commit is contained in:
parent
10538aabbf
commit
7592347715
@ -126,7 +126,7 @@ class SomfyClimate(SomfyEntity, ClimateEntity):
|
||||
"""Return hvac operation ie. heat, cool mode."""
|
||||
if self._climate.get_regulation_state() == RegulationState.TIMETABLE:
|
||||
return HVAC_MODE_AUTO
|
||||
return HVAC_MODES_MAPPING.get(self._climate.get_hvac_state())
|
||||
return HVAC_MODES_MAPPING[self._climate.get_hvac_state()]
|
||||
|
||||
@property
|
||||
def hvac_modes(self) -> list[str]:
|
||||
|
@ -33,7 +33,7 @@ class SomfyDataUpdateCoordinator(DataUpdateCoordinator):
|
||||
)
|
||||
self.data = {}
|
||||
self.client = client
|
||||
self.site_device = {}
|
||||
self.site_device: dict[str, list] = {}
|
||||
self.last_site_index = -1
|
||||
|
||||
async def _async_update_data(self) -> dict[str, Device]:
|
||||
|
@ -1,4 +1,8 @@
|
||||
"""Support for Somfy Covers."""
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import cast
|
||||
|
||||
from pymfy.api.devices.blind import Blind
|
||||
from pymfy.api.devices.category import Category
|
||||
|
||||
@ -23,6 +27,7 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.restore_state import RestoreEntity
|
||||
|
||||
from .const import COORDINATOR, DOMAIN
|
||||
from .coordinator import SomfyDataUpdateCoordinator
|
||||
from .entity import SomfyEntity
|
||||
|
||||
BLIND_DEVICE_CATEGORIES = {Category.INTERIOR_BLIND.value, Category.EXTERIOR_BLIND.value}
|
||||
@ -68,7 +73,9 @@ class SomfyCover(SomfyEntity, RestoreEntity, CoverEntity):
|
||||
|
||||
def _create_device(self) -> Blind:
|
||||
"""Update the device with the latest data."""
|
||||
self._cover = Blind(self.device, self.coordinator.client)
|
||||
self._cover = Blind(
|
||||
self.device, cast(SomfyDataUpdateCoordinator, self.coordinator).client
|
||||
)
|
||||
|
||||
@property
|
||||
def supported_features(self) -> int:
|
||||
@ -155,7 +162,7 @@ class SomfyCover(SomfyEntity, RestoreEntity, CoverEntity):
|
||||
return self._is_closing
|
||||
|
||||
@property
|
||||
def is_closed(self) -> bool:
|
||||
def is_closed(self) -> bool | None:
|
||||
"""Return if the cover is closed."""
|
||||
is_closed = None
|
||||
if self.has_state("position"):
|
||||
@ -165,7 +172,7 @@ class SomfyCover(SomfyEntity, RestoreEntity, CoverEntity):
|
||||
return is_closed
|
||||
|
||||
@property
|
||||
def current_cover_tilt_position(self) -> int:
|
||||
def current_cover_tilt_position(self) -> int | None:
|
||||
"""Return current position of cover tilt.
|
||||
|
||||
None is unknown, 0 is closed, 100 is fully open.
|
||||
|
3
mypy.ini
3
mypy.ini
@ -2206,9 +2206,6 @@ ignore_errors = true
|
||||
[mypy-homeassistant.components.solaredge.*]
|
||||
ignore_errors = true
|
||||
|
||||
[mypy-homeassistant.components.somfy.*]
|
||||
ignore_errors = true
|
||||
|
||||
[mypy-homeassistant.components.sonos.*]
|
||||
ignore_errors = true
|
||||
|
||||
|
@ -77,7 +77,6 @@ IGNORED_MODULES: Final[list[str]] = [
|
||||
"homeassistant.components.sma.*",
|
||||
"homeassistant.components.smartthings.*",
|
||||
"homeassistant.components.solaredge.*",
|
||||
"homeassistant.components.somfy.*",
|
||||
"homeassistant.components.sonos.*",
|
||||
"homeassistant.components.spotify.*",
|
||||
"homeassistant.components.stt.*",
|
||||
|
Loading…
x
Reference in New Issue
Block a user