mirror of
https://github.com/home-assistant/core
synced 2024-09-28 03:04:04 +02:00
Cleanup entity & remove warning (#9606)
* Cleanup entity & remove warning * Update comment
This commit is contained in:
parent
eb2338249f
commit
7c8e7d6eb0
@ -180,15 +180,6 @@ class Entity(object):
|
|||||||
# are used to perform a very specific function. Overwriting these may
|
# are used to perform a very specific function. Overwriting these may
|
||||||
# produce undesirable effects in the entity's operation.
|
# produce undesirable effects in the entity's operation.
|
||||||
|
|
||||||
def update_ha_state(self, force_refresh=False):
|
|
||||||
"""Update Home Assistant with current state of entity.
|
|
||||||
|
|
||||||
If force_refresh == True will update entity before setting state.
|
|
||||||
"""
|
|
||||||
_LOGGER.warning("'update_ha_state' is deprecated. "
|
|
||||||
"Use 'schedule_update_ha_state' instead.")
|
|
||||||
self.schedule_update_ha_state(force_refresh)
|
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def async_update_ha_state(self, force_refresh=False):
|
def async_update_ha_state(self, force_refresh=False):
|
||||||
"""Update Home Assistant with current state of entity.
|
"""Update Home Assistant with current state of entity.
|
||||||
@ -207,8 +198,7 @@ class Entity(object):
|
|||||||
# update entity data
|
# update entity data
|
||||||
if force_refresh:
|
if force_refresh:
|
||||||
if self._update_warn:
|
if self._update_warn:
|
||||||
_LOGGER.warning("Update for %s is already in progress",
|
# Update is already in progress.
|
||||||
self.entity_id)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
self._update_warn = self.hass.loop.call_later(
|
self._update_warn = self.hass.loop.call_later(
|
||||||
|
Loading…
Reference in New Issue
Block a user