remove more dupe code
This commit is contained in:
parent
00b1a234b8
commit
31c1b86969
|
@ -71,7 +71,6 @@ from .api_pb2 import ( # type: ignore
|
|||
VoiceAssistantResponse,
|
||||
)
|
||||
from .client_callbacks import (
|
||||
handle_timeout,
|
||||
on_ble_raw_advertisement_response,
|
||||
on_bluetooth_connections_free_response,
|
||||
on_bluetooth_device_connection_response,
|
||||
|
@ -81,7 +80,7 @@ from .client_callbacks import (
|
|||
on_state_msg,
|
||||
on_subscribe_home_assistant_state_response,
|
||||
)
|
||||
from .connection import APIConnection, ConnectionParams
|
||||
from .connection import APIConnection, ConnectionParams, handle_timeout
|
||||
from .core import (
|
||||
APIConnectionError,
|
||||
BluetoothGATTAPIError,
|
||||
|
|
|
@ -8,5 +8,3 @@ cdef object CameraImageResponse, CameraState
|
|||
cdef object HomeassistantServiceCall
|
||||
|
||||
cdef object BluetoothLEAdvertisement
|
||||
|
||||
cdef object asyncio_TimeoutError
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from asyncio import Future
|
||||
from asyncio import TimeoutError as asyncio_TimeoutError
|
||||
from typing import TYPE_CHECKING, Callable
|
||||
|
||||
from google.protobuf import message
|
||||
|
@ -98,12 +97,6 @@ def on_subscribe_home_assistant_state_response(
|
|||
on_state_sub(msg.entity_id, msg.attribute)
|
||||
|
||||
|
||||
def handle_timeout(fut: Future[None]) -> None:
|
||||
"""Handle a timeout."""
|
||||
if not fut.done():
|
||||
fut.set_exception(asyncio_TimeoutError)
|
||||
|
||||
|
||||
def on_bluetooth_device_connection_response(
|
||||
connect_future: Future[None],
|
||||
address: int,
|
||||
|
|
Loading…
Reference in New Issue