mirror of
https://github.com/home-assistant/core.git
synced 2026-04-23 18:29:20 +01:00
Replace EventType with Event [a-g] (#112739)
This commit is contained in:
@@ -23,7 +23,7 @@ from homeassistant.core import Event, HomeAssistant
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.entityfilter import FILTER_SCHEMA, EntityFilter
|
||||
from homeassistant.helpers.event import EventStateChangedData
|
||||
from homeassistant.helpers.typing import ConfigType, EventType
|
||||
from homeassistant.helpers.typing import ConfigType
|
||||
from homeassistant.util import ssl as ssl_util
|
||||
|
||||
DOMAIN = "apache_kafka"
|
||||
@@ -117,7 +117,7 @@ class KafkaManager:
|
||||
)
|
||||
self._topic = topic
|
||||
|
||||
def _encode_event(self, event: EventType[EventStateChangedData]) -> bytes | None:
|
||||
def _encode_event(self, event: Event[EventStateChangedData]) -> bytes | None:
|
||||
"""Translate events into a binary JSON payload."""
|
||||
state = event.data["new_state"]
|
||||
if (
|
||||
@@ -140,7 +140,7 @@ class KafkaManager:
|
||||
"""Shut the manager down."""
|
||||
await self._producer.stop()
|
||||
|
||||
async def write(self, event: EventType[EventStateChangedData]) -> None:
|
||||
async def write(self, event: Event[EventStateChangedData]) -> None:
|
||||
"""Write a binary payload to Kafka."""
|
||||
payload = self._encode_event(event)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user