Remove not needed code check in yale_smart_alarm (#132649)

This commit is contained in:
G Johansson 2024-12-09 08:31:42 +01:00 committed by GitHub
parent eddb416f6d
commit e0bb044782
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 10 deletions

View File

@ -9,7 +9,7 @@ from yalesmartalarmclient import YaleLock, YaleLockState
from homeassistant.components.lock import LockEntity, LockState
from homeassistant.const import ATTR_CODE
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError, ServiceValidationError
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import YaleConfigEntry
@ -65,12 +65,6 @@ class YaleDoorlock(YaleLockEntity, LockEntity):
async def async_set_lock(self, state: YaleLockState, code: str | None) -> None:
"""Set lock."""
if state is YaleLockState.UNLOCKED and not code:
raise ServiceValidationError(
translation_domain=DOMAIN,
translation_key="no_code",
)
lock_state = False
try:
if state is YaleLockState.LOCKED:

View File

@ -88,9 +88,6 @@
"set_lock": {
"message": "Could not set lock for {name}: {error}"
},
"no_code": {
"message": "Can not unlock without code"
},
"could_not_change_lock": {
"message": "Could not set lock, check system ready for lock"
},