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

@ -9,8 +9,9 @@ import logging
from homeassistant.const import (
TEMP_CELSIUS, TEMP_FAHRENHEIT)
from homeassistant.helpers.entity import Entity
from homeassistant.components.sensor import ENTITY_ID_FORMAT
from homeassistant.components.vera import (
VeraDevice, VERA_DEVICES, VERA_CONTROLLER)
VERA_CONTROLLER, VERA_DEVICES, VeraDevice)
DEPENDENCIES = ['vera']
@ -32,6 +33,7 @@ class VeraSensor(VeraDevice, Entity):
self.current_value = None
self._temperature_units = None
VeraDevice.__init__(self, vera_device, controller)
self.entity_id = ENTITY_ID_FORMAT.format(self.vera_id)
@property
def state(self):