Fix light template to return brightness as int (#12447)

pull/12484/head
Andrey 2018-02-16 19:32:11 +02:00 committed by Paulus Schoutsen
parent b651cdd8f2
commit fcf97524a2
2 changed files with 2 additions and 3 deletions

View File

@ -237,7 +237,6 @@ class LightTemplate(Light):
@asyncio.coroutine
def async_update(self):
"""Update the state from the template."""
print("ASYNC UPDATE")
if self._template is not None:
try:
state = self._template.async_render().lower()
@ -262,7 +261,7 @@ class LightTemplate(Light):
self._state = None
if 0 <= int(brightness) <= 255:
self._brightness = brightness
self._brightness = int(brightness)
else:
_LOGGER.error(
'Received invalid brightness : %s' +

View File

@ -586,7 +586,7 @@ class TestTemplateLight:
state = self.hass.states.get('light.test_template_light')
assert state is not None
assert state.attributes.get('brightness') == '42'
assert state.attributes.get('brightness') == 42
def test_friendly_name(self):
"""Test the accessibility of the friendly_name attribute."""