1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Clean up core (#10305)

* Clean up core

* Lint

* Fix tests

* Address comment

* Update entity.py

* romve test for forward update to async_update

* fix lint
This commit is contained in:
Paulus Schoutsen
2017-11-03 06:19:36 -07:00
committed by Pascal Vizeli
parent 9b8c64c8b6
commit 4e8e04fe66
7 changed files with 52 additions and 102 deletions

View File

@@ -168,15 +168,9 @@ class Entity(object):
def update(self):
"""Retrieve latest state.
When not implemented, will forward call to async version if available.
For asyncio use coroutine async_update.
"""
async_update = getattr(self, 'async_update', None)
if async_update is None:
return
# pylint: disable=not-callable
run_coroutine_threadsafe(async_update(), self.hass.loop).result()
pass
# DO NOT OVERWRITE
# These properties and methods are either managed by Home Assistant or they