Append vera device id to entity id - but not name. (#6523)

* Append vera device id to entity id - but not name.

* Tidy.

* Tidy.

* Tidy after review.

* Re-order.
This commit is contained in:
Greg Dowling 2017-03-11 18:06:46 +00:00 committed by Paulus Schoutsen
parent b2a2193ba3
commit 10f5e9744b
8 changed files with 27 additions and 15 deletions

View file

@ -6,10 +6,10 @@ https://home-assistant.io/components/lock.vera/
"""
import logging
from homeassistant.components.lock import LockDevice
from homeassistant.components.lock import ENTITY_ID_FORMAT, LockDevice
from homeassistant.const import (STATE_LOCKED, STATE_UNLOCKED)
from homeassistant.components.vera import (
VeraDevice, VERA_DEVICES, VERA_CONTROLLER)
VERA_CONTROLLER, VERA_DEVICES, VeraDevice)
_LOGGER = logging.getLogger(__name__)
@ -30,6 +30,7 @@ class VeraLock(VeraDevice, LockDevice):
"""Initialize the Vera device."""
self._state = None
VeraDevice.__init__(self, vera_device, controller)
self.entity_id = ENTITY_ID_FORMAT.format(self.vera_id)
def lock(self, **kwargs):
"""Lock the device."""