mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 09:47:52 +00:00
Add entity_id as key for kafka message (#121519)
Co-authored-by: Aaron Bach <bachya1208@gmail.com>
This commit is contained in:
parent
48d9df74ed
commit
cfabb778dd
@ -141,7 +141,8 @@ class KafkaManager:
|
||||
|
||||
async def write(self, event: Event[EventStateChangedData]) -> None:
|
||||
"""Write a binary payload to Kafka."""
|
||||
key = event.data["entity_id"].encode("utf-8")
|
||||
payload = self._encode_event(event)
|
||||
|
||||
if payload:
|
||||
await self._producer.send_and_wait(self._topic, payload)
|
||||
await self._producer.send_and_wait(self._topic, payload, key)
|
||||
|
Loading…
x
Reference in New Issue
Block a user