9c0455e3dcc3ecec1f5a81797013e60f8e20faf1,homeassistant/components/binary_sensor/template.py,BinarySensorTemplate,async_update,#BinarySensorTemplate#,116
Before Change
@asyncio.coroutine
def async_update(self):
Update the state from the template.
self._async_render()
def _async_render(self):
Render the state from the template.
try:
After Change
@asyncio.coroutine
def async_update(self):
Update the state from the template.
try:
self._state = self._template.async_render().lower() == "true"
except TemplateError as ex:
if ex.args and ex.args[0].startswith(
"UndefinedError: "None" has no attribute"):
// Common during HA startup - so just a warning
_LOGGER.warning(ex)
return
_LOGGER.error(ex)
self._state = False
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 10
Instances Project Name: home-assistant/home-assistant
Commit Name: 9c0455e3dcc3ecec1f5a81797013e60f8e20faf1
Time: 2016-10-29
Author: pascal.vizeli@syshack.ch
File Name: homeassistant/components/binary_sensor/template.py
Class Name: BinarySensorTemplate
Method Name: async_update
Project Name: home-assistant/home-assistant
Commit Name: 9c0455e3dcc3ecec1f5a81797013e60f8e20faf1
Time: 2016-10-29
Author: pascal.vizeli@syshack.ch
File Name: homeassistant/components/sensor/template.py
Class Name: SensorTemplate
Method Name: async_update
Project Name: home-assistant/home-assistant
Commit Name: 9c0455e3dcc3ecec1f5a81797013e60f8e20faf1
Time: 2016-10-29
Author: pascal.vizeli@syshack.ch
File Name: homeassistant/components/switch/template.py
Class Name: SwitchTemplate
Method Name: async_update