mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 15:17:35 +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
|
# Retrieve the largest window_size of each type
|
||||||
if largest_window_items > 0:
|
if largest_window_items > 0:
|
||||||
filter_history = await self.hass.async_add_job(
|
filter_history = await self.hass.async_add_executor_job(
|
||||||
partial(
|
partial(
|
||||||
history.get_last_state_changes,
|
history.get_last_state_changes,
|
||||||
self.hass,
|
self.hass,
|
||||||
@ -257,7 +257,7 @@ class SensorFilter(Entity):
|
|||||||
history_list.extend(filter_history[self._entity])
|
history_list.extend(filter_history[self._entity])
|
||||||
if largest_window_time > timedelta(seconds=0):
|
if largest_window_time > timedelta(seconds=0):
|
||||||
start = dt_util.utcnow() - largest_window_time
|
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(
|
partial(
|
||||||
history.state_changes_during_period,
|
history.state_changes_during_period,
|
||||||
self.hass,
|
self.hass,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user