diff --git a/homeassistant/components/light/template.py b/homeassistant/components/light/template.py index d4f2b93e6b5..cfd050f54f2 100644 --- a/homeassistant/components/light/template.py +++ b/homeassistant/components/light/template.py @@ -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' + diff --git a/tests/components/light/test_template.py b/tests/components/light/test_template.py index aaac0617590..2d45ad1bf94 100644 --- a/tests/components/light/test_template.py +++ b/tests/components/light/test_template.py @@ -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."""