Bump `aiokafka` to 0.10.0 (#108165)
parent
d82abd93fb
commit
25f4fe4a85
|
@ -3,9 +3,9 @@ from __future__ import annotations
|
|||
|
||||
from datetime import datetime
|
||||
import json
|
||||
import sys
|
||||
from typing import Any, Literal
|
||||
|
||||
from aiokafka import AIOKafkaProducer
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.const import (
|
||||
|
@ -19,17 +19,12 @@ from homeassistant.const import (
|
|||
STATE_UNKNOWN,
|
||||
)
|
||||
from homeassistant.core import Event, HomeAssistant
|
||||
from homeassistant.exceptions import HomeAssistantError
|
||||
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.util import ssl as ssl_util
|
||||
|
||||
if sys.version_info < (3, 12):
|
||||
from aiokafka import AIOKafkaProducer
|
||||
|
||||
|
||||
DOMAIN = "apache_kafka"
|
||||
|
||||
CONF_FILTER = "filter"
|
||||
|
@ -58,10 +53,6 @@ CONFIG_SCHEMA = vol.Schema(
|
|||
|
||||
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
||||
"""Activate the Apache Kafka integration."""
|
||||
if sys.version_info >= (3, 12):
|
||||
raise HomeAssistantError(
|
||||
"Apache Kafka is not supported on Python 3.12. Please use Python 3.11."
|
||||
)
|
||||
conf = config[DOMAIN]
|
||||
|
||||
kafka = hass.data[DOMAIN] = KafkaManager(
|
||||
|
|
|
@ -5,5 +5,5 @@
|
|||
"documentation": "https://www.home-assistant.io/integrations/apache_kafka",
|
||||
"iot_class": "local_push",
|
||||
"loggers": ["aiokafka", "kafka_python"],
|
||||
"requirements": ["aiokafka==0.7.2"]
|
||||
"requirements": ["aiokafka==0.10.0"]
|
||||
}
|
||||
|
|
|
@ -276,7 +276,7 @@ aiohue==4.7.0
|
|||
aioimaplib==1.0.1
|
||||
|
||||
# homeassistant.components.apache_kafka
|
||||
aiokafka==0.7.2
|
||||
aiokafka==0.10.0
|
||||
|
||||
# homeassistant.components.kef
|
||||
aiokef==0.2.16
|
||||
|
|
|
@ -252,7 +252,7 @@ aiohue==4.7.0
|
|||
aioimaplib==1.0.1
|
||||
|
||||
# homeassistant.components.apache_kafka
|
||||
aiokafka==0.7.2
|
||||
aiokafka==0.10.0
|
||||
|
||||
# homeassistant.components.lifx
|
||||
aiolifx-effects==0.3.2
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
"""Skip test collection."""
|
||||
import sys
|
||||
|
||||
if sys.version_info >= (3, 12):
|
||||
collect_ignore_glob = ["test_*.py"]
|
|
@ -62,7 +62,7 @@ async def test_minimal_config(
|
|||
config = {apache_kafka.DOMAIN: MIN_CONFIG}
|
||||
assert await async_setup_component(hass, apache_kafka.DOMAIN, config)
|
||||
await hass.async_block_till_done()
|
||||
assert mock_client.start.called_once
|
||||
mock_client.start.assert_called_once()
|
||||
|
||||
|
||||
async def test_full_config(hass: HomeAssistant, mock_client: MockKafkaClient) -> None:
|
||||
|
@ -83,7 +83,7 @@ async def test_full_config(hass: HomeAssistant, mock_client: MockKafkaClient) ->
|
|||
|
||||
assert await async_setup_component(hass, apache_kafka.DOMAIN, config)
|
||||
await hass.async_block_till_done()
|
||||
assert mock_client.start.called_once
|
||||
mock_client.start.assert_called_once()
|
||||
|
||||
|
||||
async def _setup(hass, filter_config):
|
||||
|
|
Loading…
Reference in New Issue