Restore accessory state into pairing using new HKC methods (#75276)

This commit is contained in:
J. Nick Koston 2022-07-16 12:49:15 -05:00 committed by GitHub
parent ecc219fbc1
commit b9c8d65940
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 130 additions and 91 deletions

View file

@ -15,6 +15,7 @@ from homeassistant.components.automation import (
AutomationTriggerInfo,
)
from homeassistant.components.device_automation import DEVICE_TRIGGER_BASE_SCHEMA
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_DEVICE_ID, CONF_DOMAIN, CONF_PLATFORM, CONF_TYPE
from homeassistant.core import CALLBACK_TYPE, HomeAssistant, callback
from homeassistant.helpers.typing import ConfigType
@ -195,7 +196,9 @@ TRIGGER_FINDERS = {
}
async def async_setup_triggers_for_entry(hass: HomeAssistant, config_entry):
async def async_setup_triggers_for_entry(
hass: HomeAssistant, config_entry: ConfigEntry
) -> None:
"""Triggers aren't entities as they have no state, but we still need to set them up for a config entry."""
hkid = config_entry.data["AccessoryPairingID"]
conn: HKDevice = hass.data[KNOWN_DEVICES][hkid]