Remove screenlogic from mypy ignore list (#64512)
* Adjust screenlogic * Adjust mypy_config * Adjust coordinator cast * Move cast higher up Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
ca6dd09fc2
commit
e56c64db07
4 changed files with 8 additions and 8 deletions
|
@ -1,5 +1,6 @@
|
||||||
"""Support for a ScreenLogic number entity."""
|
"""Support for a ScreenLogic number entity."""
|
||||||
import logging
|
import logging
|
||||||
|
from typing import cast
|
||||||
|
|
||||||
from screenlogicpy.const import BODY_TYPE, DATA as SL_DATA, EQUIPMENT, SCG
|
from screenlogicpy.const import BODY_TYPE, DATA as SL_DATA, EQUIPMENT, SCG
|
||||||
|
|
||||||
|
@ -8,7 +9,7 @@ from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
from . import ScreenlogicEntity
|
from . import ScreenlogicDataUpdateCoordinator, ScreenlogicEntity
|
||||||
from .const import DOMAIN
|
from .const import DOMAIN
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
@ -57,14 +58,16 @@ class ScreenLogicNumber(ScreenlogicEntity, NumberEntity):
|
||||||
|
|
||||||
async def async_set_value(self, value: float) -> None:
|
async def async_set_value(self, value: float) -> None:
|
||||||
"""Update the current value."""
|
"""Update the current value."""
|
||||||
|
coordinator = cast(ScreenlogicDataUpdateCoordinator, self.coordinator)
|
||||||
|
|
||||||
# Need to set both levels at the same time, so we gather
|
# Need to set both levels at the same time, so we gather
|
||||||
# both existing level values and override the one that changed.
|
# both existing level values and override the one that changed.
|
||||||
levels = {}
|
levels = {}
|
||||||
for level in SUPPORTED_SCG_NUMBERS:
|
for level in SUPPORTED_SCG_NUMBERS:
|
||||||
levels[level] = self.coordinator.data[SL_DATA.KEY_SCG][level]["value"]
|
levels[level] = coordinator.data[SL_DATA.KEY_SCG][level]["value"]
|
||||||
levels[self._data_key] = int(value)
|
levels[self._data_key] = int(value)
|
||||||
|
|
||||||
if await self.coordinator.gateway.async_set_scg_config(
|
if await coordinator.gateway.async_set_scg_config(
|
||||||
levels[SUPPORTED_SCG_NUMBERS[BODY_TYPE.POOL]],
|
levels[SUPPORTED_SCG_NUMBERS[BODY_TYPE.POOL]],
|
||||||
levels[SUPPORTED_SCG_NUMBERS[BODY_TYPE.SPA]],
|
levels[SUPPORTED_SCG_NUMBERS[BODY_TYPE.SPA]],
|
||||||
):
|
):
|
||||||
|
|
|
@ -37,7 +37,8 @@ def async_load_screenlogic_services(hass: HomeAssistant):
|
||||||
return [
|
return [
|
||||||
entry_id
|
entry_id
|
||||||
for entry_id in await async_extract_config_entry_ids(hass, service_call)
|
for entry_id in await async_extract_config_entry_ids(hass, service_call)
|
||||||
if hass.config_entries.async_get_entry(entry_id).domain == DOMAIN
|
if (entry := hass.config_entries.async_get_entry(entry_id))
|
||||||
|
and entry.domain == DOMAIN
|
||||||
]
|
]
|
||||||
|
|
||||||
async def async_set_color_mode(service_call: ServiceCall) -> None:
|
async def async_set_color_mode(service_call: ServiceCall) -> None:
|
||||||
|
|
3
mypy.ini
3
mypy.ini
|
@ -2182,9 +2182,6 @@ ignore_errors = true
|
||||||
[mypy-homeassistant.components.ruckus_unleashed.*]
|
[mypy-homeassistant.components.ruckus_unleashed.*]
|
||||||
ignore_errors = true
|
ignore_errors = true
|
||||||
|
|
||||||
[mypy-homeassistant.components.screenlogic.*]
|
|
||||||
ignore_errors = true
|
|
||||||
|
|
||||||
[mypy-homeassistant.components.search.*]
|
[mypy-homeassistant.components.search.*]
|
||||||
ignore_errors = true
|
ignore_errors = true
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,6 @@ IGNORED_MODULES: Final[list[str]] = [
|
||||||
"homeassistant.components.profiler.*",
|
"homeassistant.components.profiler.*",
|
||||||
"homeassistant.components.ring.*",
|
"homeassistant.components.ring.*",
|
||||||
"homeassistant.components.ruckus_unleashed.*",
|
"homeassistant.components.ruckus_unleashed.*",
|
||||||
"homeassistant.components.screenlogic.*",
|
|
||||||
"homeassistant.components.search.*",
|
"homeassistant.components.search.*",
|
||||||
"homeassistant.components.sense.*",
|
"homeassistant.components.sense.*",
|
||||||
"homeassistant.components.sharkiq.*",
|
"homeassistant.components.sharkiq.*",
|
||||||
|
|
Loading…
Add table
Reference in a new issue