mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Update recorder callback (#3812)
This commit is contained in:
parent
a99f36f519
commit
a8cdf36d5c
@ -7,7 +7,6 @@ to query this database.
|
|||||||
For more details about this component, please refer to the documentation at
|
For more details about this component, please refer to the documentation at
|
||||||
https://home-assistant.io/components/recorder/
|
https://home-assistant.io/components/recorder/
|
||||||
"""
|
"""
|
||||||
import asyncio
|
|
||||||
import logging
|
import logging
|
||||||
import queue
|
import queue
|
||||||
import threading
|
import threading
|
||||||
@ -17,7 +16,7 @@ from typing import Any, Union, Optional, List
|
|||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.const import (EVENT_HOMEASSISTANT_START,
|
from homeassistant.const import (EVENT_HOMEASSISTANT_START,
|
||||||
EVENT_HOMEASSISTANT_STOP, EVENT_STATE_CHANGED,
|
EVENT_HOMEASSISTANT_STOP, EVENT_STATE_CHANGED,
|
||||||
EVENT_TIME_CHANGED, MATCH_ALL)
|
EVENT_TIME_CHANGED, MATCH_ALL)
|
||||||
@ -225,7 +224,7 @@ class Recorder(threading.Thread):
|
|||||||
|
|
||||||
self.queue.task_done()
|
self.queue.task_done()
|
||||||
|
|
||||||
@asyncio.coroutine
|
@callback
|
||||||
def event_listener(self, event):
|
def event_listener(self, event):
|
||||||
"""Listen for new events and put them in the process queue."""
|
"""Listen for new events and put them in the process queue."""
|
||||||
self.queue.put(event)
|
self.queue.put(event)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user