Update filter to use async_add_executor_job (#41455)

This commit is contained in:
J. Nick Koston 2020-10-08 02:22:51 -05:00 committed by GitHub
parent 740d15e41d
commit 7537a3a7c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -245,7 +245,7 @@ class SensorFilter(Entity):
# Retrieve the largest window_size of each type
if largest_window_items > 0:
filter_history = await self.hass.async_add_job(
filter_history = await self.hass.async_add_executor_job(
partial(
history.get_last_state_changes,
self.hass,
@ -257,7 +257,7 @@ class SensorFilter(Entity):
history_list.extend(filter_history[self._entity])
if largest_window_time > timedelta(seconds=0):
start = dt_util.utcnow() - largest_window_time
filter_history = await self.hass.async_add_job(
filter_history = await self.hass.async_add_executor_job(
partial(
history.state_changes_during_period,
self.hass,