mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Use SignalType to improve typing [homekit] (#114297)
This commit is contained in:
parent
e626cd12aa
commit
63e28f958d
@ -121,6 +121,7 @@ from .const import (
|
||||
SERVICE_HOMEKIT_RESET_ACCESSORY,
|
||||
SERVICE_HOMEKIT_UNPAIR,
|
||||
SHUTDOWN_TIMEOUT,
|
||||
SIGNAL_RELOAD_ENTITIES,
|
||||
)
|
||||
from .iidmanager import AccessoryIIDStorage
|
||||
from .models import HomeKitEntryData
|
||||
@ -846,7 +847,7 @@ class HomeKit:
|
||||
self.status = STATUS_WAIT
|
||||
self._cancel_reload_dispatcher = async_dispatcher_connect(
|
||||
self.hass,
|
||||
f"homekit_reload_entities_{self._entry_id}",
|
||||
SIGNAL_RELOAD_ENTITIES.format(self._entry_id),
|
||||
self.async_reload_accessories,
|
||||
)
|
||||
async_zc_instance = await zeroconf.async_get_async_instance(self.hass)
|
||||
|
@ -84,6 +84,7 @@ from .const import (
|
||||
MAX_VERSION_LENGTH,
|
||||
SERV_ACCESSORY_INFO,
|
||||
SERV_BATTERY_SERVICE,
|
||||
SIGNAL_RELOAD_ENTITIES,
|
||||
TYPE_FAUCET,
|
||||
TYPE_OUTLET,
|
||||
TYPE_SHOWER,
|
||||
@ -621,7 +622,7 @@ class HomeAccessory(Accessory): # type: ignore[misc]
|
||||
"""Reload and recreate an accessory and update the c# value in the mDNS record."""
|
||||
async_dispatcher_send(
|
||||
self.hass,
|
||||
f"homekit_reload_entities_{self.driver.entry_id}",
|
||||
SIGNAL_RELOAD_ENTITIES.format(self.driver.entry_id),
|
||||
(self.entity_id,),
|
||||
)
|
||||
|
||||
|
@ -1,6 +1,9 @@
|
||||
"""Constants used be the HomeKit component."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from homeassistant.const import CONF_DEVICES
|
||||
from homeassistant.util.signal_type import SignalTypeFormat
|
||||
|
||||
# #### Misc ####
|
||||
DEBOUNCE_TIMEOUT = 0.5
|
||||
@ -11,6 +14,9 @@ HOMEKIT_FILE = ".homekit.state"
|
||||
SHUTDOWN_TIMEOUT = 30
|
||||
CONF_ENTRY_INDEX = "index"
|
||||
EMPTY_MAC = "00:00:00:00:00:00"
|
||||
SIGNAL_RELOAD_ENTITIES: SignalTypeFormat[tuple[str, ...]] = SignalTypeFormat(
|
||||
"homekit_reload_entities_{}"
|
||||
)
|
||||
|
||||
# ### Codecs ####
|
||||
VIDEO_CODEC_COPY = "copy"
|
||||
|
Loading…
x
Reference in New Issue
Block a user