From 143e6a7adc74f6fd8b5d5037b9f772f35150dac3 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Wed, 22 Jun 2022 17:23:51 +0200 Subject: [PATCH] Add missing type hints in locks (#73831) --- homeassistant/components/sesame/lock.py | 6 ++++-- homeassistant/components/verisure/lock.py | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/sesame/lock.py b/homeassistant/components/sesame/lock.py index 99bb2d8a865..b9a230fed63 100644 --- a/homeassistant/components/sesame/lock.py +++ b/homeassistant/components/sesame/lock.py @@ -1,6 +1,8 @@ """Support for Sesame, by CANDY HOUSE.""" from __future__ import annotations +from typing import Any + import pysesame2 import voluptuous as vol @@ -61,11 +63,11 @@ class SesameDevice(LockEntity): """Return True if the device is currently locked, else False.""" return self._is_locked - def lock(self, **kwargs) -> None: + def lock(self, **kwargs: Any) -> None: """Lock the device.""" self._sesame.lock() - def unlock(self, **kwargs) -> None: + def unlock(self, **kwargs: Any) -> None: """Unlock the device.""" self._sesame.unlock() diff --git a/homeassistant/components/verisure/lock.py b/homeassistant/components/verisure/lock.py index 8f9556643f8..f96b99e2a8c 100644 --- a/homeassistant/components/verisure/lock.py +++ b/homeassistant/components/verisure/lock.py @@ -2,6 +2,7 @@ from __future__ import annotations import asyncio +from typing import Any from verisure import Error as VerisureError @@ -122,7 +123,7 @@ class VerisureDoorlock(CoordinatorEntity[VerisureDataUpdateCoordinator], LockEnt """Return the state attributes.""" return {"method": self.changed_method} - async def async_unlock(self, **kwargs) -> None: + async def async_unlock(self, **kwargs: Any) -> None: """Send unlock command.""" code = kwargs.get( ATTR_CODE, self.coordinator.entry.options.get(CONF_LOCK_DEFAULT_CODE) @@ -133,7 +134,7 @@ class VerisureDoorlock(CoordinatorEntity[VerisureDataUpdateCoordinator], LockEnt await self.async_set_lock_state(code, STATE_UNLOCKED) - async def async_lock(self, **kwargs) -> None: + async def async_lock(self, **kwargs: Any) -> None: """Send lock command.""" code = kwargs.get( ATTR_CODE, self.coordinator.entry.options.get(CONF_LOCK_DEFAULT_CODE)