Fix TCP sensor to correctly use value_template (#5211)

* Fix TCP sensor to correctly use value_template

* Fix TCP component tests

* Update tcp.py
This commit is contained in:
Andrew Williams authored and Paulus Schoutsen committed 2017-01-11 17:26:29 +01:00
1 parent 3f3a3bcc8a
commit 1cf9ae5a01
2 files changed
+5 -5

No files matched your search

+1 -2
View File
@@ -16,7 +16,6 @@ from homeassistant.const import (
CONF_UNIT_OF_MEASUREMENT, CONF_VALUE_TEMPLATE)
from homeassistant.exceptions import TemplateError
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.template import Template
import homeassistant.helpers.config_validation as cv
_LOGGER = logging.getLogger(__name__)
@@ -57,7 +56,7 @@ class TcpSensor(Entity):
value_template = config.get(CONF_VALUE_TEMPLATE)
if value_template is not None:
value_template = Template(value_template, hass)
value_template.hass = hass
self._hass = hass
self._config = {