mirror of
https://github.com/home-assistant/core.git
synced 2025-11-16 14:30:22 +00:00
Enable types from aiohomekit to be used by mypy for homekit_controller (#65433)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
"""Provides device automations for homekit devices."""
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from aiohomekit.model.characteristics import CharacteristicsTypes
|
||||
from aiohomekit.model.characteristics.const import InputEventValues
|
||||
@@ -20,6 +20,9 @@ from homeassistant.helpers.typing import ConfigType
|
||||
|
||||
from .const import DOMAIN, KNOWN_DEVICES, TRIGGERS
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .connection import HKDevice
|
||||
|
||||
TRIGGER_TYPES = {
|
||||
"doorbell",
|
||||
"button1",
|
||||
@@ -225,7 +228,7 @@ async def async_setup_triggers_for_entry(hass: HomeAssistant, config_entry):
|
||||
conn.add_listener(async_add_service)
|
||||
|
||||
|
||||
def async_fire_triggers(conn, events):
|
||||
def async_fire_triggers(conn: HKDevice, events: dict[tuple[int, int], Any]):
|
||||
"""Process events generated by a HomeKit accessory into automation triggers."""
|
||||
for (aid, iid), ev in events.items():
|
||||
if aid in conn.devices:
|
||||
|
||||
Reference in New Issue
Block a user