mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Update filter to use async_add_executor_job (#41455)
This commit is contained in:
parent
740d15e41d
commit
7537a3a7c8
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user