mirror of
https://github.com/home-assistant/core.git
synced 2025-07-10 23:07:09 +00:00
Add lock.open service to nello (#42141)
This commit is contained in:
parent
cf5be049b3
commit
39e7b30ab6
@ -5,7 +5,7 @@ import logging
|
|||||||
from pynello.private import Nello
|
from pynello.private import Nello
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.lock import PLATFORM_SCHEMA, LockEntity
|
from homeassistant.components.lock import PLATFORM_SCHEMA, SUPPORT_OPEN, LockEntity
|
||||||
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
|
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
|
|
||||||
@ -85,3 +85,13 @@ class NelloLock(LockEntity):
|
|||||||
"""Unlock the device."""
|
"""Unlock the device."""
|
||||||
if not self._nello_lock.open_door():
|
if not self._nello_lock.open_door():
|
||||||
_LOGGER.error("Failed to unlock")
|
_LOGGER.error("Failed to unlock")
|
||||||
|
|
||||||
|
def open(self, **kwargs):
|
||||||
|
"""Unlock the device."""
|
||||||
|
if not self._nello_lock.open_door():
|
||||||
|
_LOGGER.error("Failed to open")
|
||||||
|
|
||||||
|
@property
|
||||||
|
def supported_features(self):
|
||||||
|
"""Flag supported features."""
|
||||||
|
return SUPPORT_OPEN
|
||||||
|
Loading…
x
Reference in New Issue
Block a user