Remove sma from mypy ignore list (#64510)

pull/64527/head
epenet 2022-01-20 08:22:18 +01:00 committed by GitHub
parent 03bf2cdd56
commit e248ef1dd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 4 deletions

View File

@ -3,6 +3,7 @@ from __future__ import annotations
from datetime import timedelta from datetime import timedelta
import logging import logging
from typing import TYPE_CHECKING
import pysma import pysma
@ -58,6 +59,9 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
) as exc: ) as exc:
raise ConfigEntryNotReady from exc raise ConfigEntryNotReady from exc
if TYPE_CHECKING:
assert entry.unique_id
# Create DeviceInfo object from sma_device_info # Create DeviceInfo object from sma_device_info
device_info = DeviceInfo( device_info = DeviceInfo(
configuration_url=url, configuration_url=url,

View File

@ -1,6 +1,8 @@
"""SMA Solar Webconnect interface.""" """SMA Solar Webconnect interface."""
from __future__ import annotations from __future__ import annotations
from typing import TYPE_CHECKING
import pysma import pysma
from homeassistant.components.sensor import ( from homeassistant.components.sensor import (
@ -34,6 +36,9 @@ async def async_setup_entry(
used_sensors = sma_data[PYSMA_SENSORS] used_sensors = sma_data[PYSMA_SENSORS]
device_info = sma_data[PYSMA_DEVICE_INFO] device_info = sma_data[PYSMA_DEVICE_INFO]
if TYPE_CHECKING:
assert config_entry.unique_id
entities = [] entities = []
for sensor in used_sensors: for sensor in used_sensors:
entities.append( entities.append(

View File

@ -2197,9 +2197,6 @@ ignore_errors = true
[mypy-homeassistant.components.sharkiq.*] [mypy-homeassistant.components.sharkiq.*]
ignore_errors = true ignore_errors = true
[mypy-homeassistant.components.sma.*]
ignore_errors = true
[mypy-homeassistant.components.smartthings.*] [mypy-homeassistant.components.smartthings.*]
ignore_errors = true ignore_errors = true

View File

@ -74,7 +74,6 @@ IGNORED_MODULES: Final[list[str]] = [
"homeassistant.components.search.*", "homeassistant.components.search.*",
"homeassistant.components.sense.*", "homeassistant.components.sense.*",
"homeassistant.components.sharkiq.*", "homeassistant.components.sharkiq.*",
"homeassistant.components.sma.*",
"homeassistant.components.smartthings.*", "homeassistant.components.smartthings.*",
"homeassistant.components.solaredge.*", "homeassistant.components.solaredge.*",
"homeassistant.components.sonos.*", "homeassistant.components.sonos.*",