async_create_task (#17059)

* async_create_task

* Update google.py
This commit is contained in:
cdce8p authored and Paulus Schoutsen committed 2018-10-02 11:03:09 +02:00
1 parent 37706c2731
commit 7f0a50ce31
41 files changed
+76 -72

No files matched your search

+3 -3
View File
@@ -55,7 +55,7 @@ async def async_setup(hass, config):
entry.get(CONF_ICON), entry.get(CONF_PASSIVE))
zone.entity_id = async_generate_entity_id(
ENTITY_ID_FORMAT, entry[CONF_NAME], entities)
hass.async_add_job(zone.async_update_ha_state())
hass.async_create_task(zone.async_update_ha_state())
entities.add(zone.entity_id)
if ENTITY_ID_HOME not in entities and HOME_ZONE not in zone_entries:
@@ -63,7 +63,7 @@ async def async_setup(hass, config):
hass.config.latitude, hass.config.longitude,
DEFAULT_RADIUS, ICON_HOME, False)
zone.entity_id = ENTITY_ID_HOME
hass.async_add_job(zone.async_update_ha_state())
hass.async_create_task(zone.async_update_ha_state())
return True
@@ -77,7 +77,7 @@ async def async_setup_entry(hass, config_entry):
entry.get(CONF_PASSIVE, DEFAULT_PASSIVE))
zone.entity_id = async_generate_entity_id(
ENTITY_ID_FORMAT, name, None, hass)
hass.async_add_job(zone.async_update_ha_state())
hass.async_create_task(zone.async_update_ha_state())
hass.data[DOMAIN][slugify(name)] = zone
return True