mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 09:47:13 +00:00
Remove verisure from mypy ignore list (#64475)
This commit is contained in:
parent
944f2c9745
commit
29ec65f924
@ -46,7 +46,7 @@ async def async_setup_entry(
|
|||||||
class VerisureSmartcam(CoordinatorEntity, Camera):
|
class VerisureSmartcam(CoordinatorEntity, Camera):
|
||||||
"""Representation of a Verisure camera."""
|
"""Representation of a Verisure camera."""
|
||||||
|
|
||||||
coordinator = VerisureDataUpdateCoordinator
|
coordinator: VerisureDataUpdateCoordinator
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
@ -63,7 +63,7 @@ class VerisureSmartcam(CoordinatorEntity, Camera):
|
|||||||
|
|
||||||
self.serial_number = serial_number
|
self.serial_number = serial_number
|
||||||
self._directory_path = directory_path
|
self._directory_path = directory_path
|
||||||
self._image = None
|
self._image: str | None = None
|
||||||
self._image_id = None
|
self._image_id = None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -87,7 +87,7 @@ class VerisureSmartcam(CoordinatorEntity, Camera):
|
|||||||
self.check_imagelist()
|
self.check_imagelist()
|
||||||
if not self._image:
|
if not self._image:
|
||||||
LOGGER.debug("No image to display")
|
LOGGER.debug("No image to display")
|
||||||
return
|
return None
|
||||||
LOGGER.debug("Trying to open %s", self._image)
|
LOGGER.debug("Trying to open %s", self._image)
|
||||||
with open(self._image, "rb") as file:
|
with open(self._image, "rb") as file:
|
||||||
return file.read()
|
return file.read()
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
"""Config flow for Verisure integration."""
|
"""Config flow for Verisure integration."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Any
|
from typing import Any, cast
|
||||||
|
|
||||||
from verisure import (
|
from verisure import (
|
||||||
Error as VerisureError,
|
Error as VerisureError,
|
||||||
@ -110,7 +110,10 @@ class VerisureConfigFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
|
|
||||||
async def async_step_reauth(self, data: dict[str, Any]) -> FlowResult:
|
async def async_step_reauth(self, data: dict[str, Any]) -> FlowResult:
|
||||||
"""Handle initiation of re-authentication with Verisure."""
|
"""Handle initiation of re-authentication with Verisure."""
|
||||||
self.entry = self.hass.config_entries.async_get_entry(self.context["entry_id"])
|
self.entry = cast(
|
||||||
|
ConfigEntry,
|
||||||
|
self.hass.config_entries.async_get_entry(self.context["entry_id"]),
|
||||||
|
)
|
||||||
return await self.async_step_reauth_confirm()
|
return await self.async_step_reauth_confirm()
|
||||||
|
|
||||||
async def async_step_reauth_confirm(
|
async def async_step_reauth_confirm(
|
||||||
|
@ -25,7 +25,7 @@ class VerisureDataUpdateCoordinator(DataUpdateCoordinator):
|
|||||||
|
|
||||||
def __init__(self, hass: HomeAssistant, entry: ConfigEntry) -> None:
|
def __init__(self, hass: HomeAssistant, entry: ConfigEntry) -> None:
|
||||||
"""Initialize the Verisure hub."""
|
"""Initialize the Verisure hub."""
|
||||||
self.imageseries = {}
|
self.imageseries: dict[str, list] = {}
|
||||||
self.entry = entry
|
self.entry = entry
|
||||||
|
|
||||||
self.verisure = Verisure(
|
self.verisure = Verisure(
|
||||||
@ -52,14 +52,12 @@ class VerisureDataUpdateCoordinator(DataUpdateCoordinator):
|
|||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
async def async_logout(self, _event: Event) -> bool:
|
async def async_logout(self, _event: Event) -> None:
|
||||||
"""Logout from Verisure."""
|
"""Logout from Verisure."""
|
||||||
try:
|
try:
|
||||||
await self.hass.async_add_executor_job(self.verisure.logout)
|
await self.hass.async_add_executor_job(self.verisure.logout)
|
||||||
except VerisureError as ex:
|
except VerisureError as ex:
|
||||||
LOGGER.error("Could not log out from verisure, %s", ex)
|
LOGGER.error("Could not log out from verisure, %s", ex)
|
||||||
return False
|
|
||||||
return True
|
|
||||||
|
|
||||||
async def _async_update_data(self) -> dict:
|
async def _async_update_data(self) -> dict:
|
||||||
"""Fetch data from Verisure."""
|
"""Fetch data from Verisure."""
|
||||||
|
@ -70,7 +70,7 @@ class VerisureDoorlock(CoordinatorEntity, LockEntity):
|
|||||||
self._attr_unique_id = serial_number
|
self._attr_unique_id = serial_number
|
||||||
|
|
||||||
self.serial_number = serial_number
|
self.serial_number = serial_number
|
||||||
self._state = None
|
self._state: str | None = None
|
||||||
self._digits = coordinator.entry.options.get(
|
self._digits = coordinator.entry.options.get(
|
||||||
CONF_LOCK_CODE_DIGITS, DEFAULT_LOCK_CODE_DIGITS
|
CONF_LOCK_CODE_DIGITS, DEFAULT_LOCK_CODE_DIGITS
|
||||||
)
|
)
|
||||||
|
@ -42,7 +42,7 @@ class VerisureSmartplug(CoordinatorEntity, SwitchEntity):
|
|||||||
self._attr_unique_id = serial_number
|
self._attr_unique_id = serial_number
|
||||||
|
|
||||||
self.serial_number = serial_number
|
self.serial_number = serial_number
|
||||||
self._change_timestamp = 0
|
self._change_timestamp: float = 0
|
||||||
self._state = False
|
self._state = False
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
3
mypy.ini
3
mypy.ini
@ -2239,9 +2239,6 @@ ignore_errors = true
|
|||||||
[mypy-homeassistant.components.vera.*]
|
[mypy-homeassistant.components.vera.*]
|
||||||
ignore_errors = true
|
ignore_errors = true
|
||||||
|
|
||||||
[mypy-homeassistant.components.verisure.*]
|
|
||||||
ignore_errors = true
|
|
||||||
|
|
||||||
[mypy-homeassistant.components.vizio.*]
|
[mypy-homeassistant.components.vizio.*]
|
||||||
ignore_errors = true
|
ignore_errors = true
|
||||||
|
|
||||||
|
@ -88,7 +88,6 @@ IGNORED_MODULES: Final[list[str]] = [
|
|||||||
"homeassistant.components.unifi.*",
|
"homeassistant.components.unifi.*",
|
||||||
"homeassistant.components.upnp.*",
|
"homeassistant.components.upnp.*",
|
||||||
"homeassistant.components.vera.*",
|
"homeassistant.components.vera.*",
|
||||||
"homeassistant.components.verisure.*",
|
|
||||||
"homeassistant.components.vizio.*",
|
"homeassistant.components.vizio.*",
|
||||||
"homeassistant.components.withings.*",
|
"homeassistant.components.withings.*",
|
||||||
"homeassistant.components.xbox.*",
|
"homeassistant.components.xbox.*",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user