Switch a few more async_track_state_change to the faster async_track_state_change_event (#37833)

async_track_state_change_event is faster than async_track_state_change
and since we do not care about the data being returned to the callback
this is a simple speedup
This commit is contained in:
J. Nick Koston authored and GitHub committed 2020-07-14 22:31:34 -07:00
1 parent b12566e265
commit 20d5d3c162
3 files changed
+10 -12

No files matched your search

@@ -8,7 +8,7 @@ from homeassistant.const import EVENT_STATE_CHANGED, EVENT_TIME_CHANGED, MATCH_A
from homeassistant.core import DOMAIN as HASS_DOMAIN, callback
from homeassistant.exceptions import HomeAssistantError, ServiceNotFound, Unauthorized
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.event import async_track_state_change
from homeassistant.helpers.event import async_track_state_change_event
from homeassistant.helpers.service import async_get_all_descriptions
from homeassistant.loader import IntegrationNotFound, async_get_integration
@@ -255,7 +255,7 @@ def handle_render_template(hass, connection, msg):
)
if entity_ids and entity_ids != MATCH_ALL:
connection.subscriptions[msg["id"]] = async_track_state_change(
connection.subscriptions[msg["id"]] = async_track_state_change_event(
hass, entity_ids, state_listener
)
else: