mirror of
https://github.com/home-assistant/developers.home-assistant.git
synced 2025-07-13 12:26:29 +00:00
Add blog post about the removal of time_changed (#1298)
This commit is contained in:
parent
35bd63bb0e
commit
808f83cb42
17
blog/2022-04-20-saying-goodbye-to-event_time_changed.md
Normal file
17
blog/2022-04-20-saying-goodbye-to-event_time_changed.md
Normal file
@ -0,0 +1,17 @@
|
||||
---
|
||||
author: J. Nick Koston
|
||||
authorURL: https://github.com/bdraco
|
||||
title: "Saying goodbye to the time_changed event"
|
||||
---
|
||||
|
||||
With Home Assistant Core 0.113, we began transiting to using the asyncio event loop for scheduling events.
|
||||
|
||||
With 2022.5, we are excited to announce that this process is now complete. The legacy `time_changed` event, also known as `EVENT_TIME_CHANGED` is no longer fired every second. Integrations that listen for all events no longer need to filter out `EVENT_TIME_CHANGED`. Integrations that run in a separate thread may see slight performance benefits since they will no longer be awakened every second.
|
||||
|
||||
With the previous implementation, consumers would subscribe to the `timed_changed` event and check the time every time it fired to see if it was a match. This pattern led to many callbacks where most of the time, the callback would reject the event and continue receiving callbacks until the desired time was reached.
|
||||
|
||||
If your custom integration is still relying on listening for `timed_changed` events, it will need to transition to using one of the built-in event helpers, which are, in most cases, a one-line drop-in replacement. For more information, please review the [integration
|
||||
documentation on listening for events](https://developers.home-assistant.io/docs/integration_listen_events#tracking-time-changes).
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user