Enable types from aiohomekit to be used by mypy for homekit_controller (#65433)
This commit is contained in:
parent
6c38a6b569
commit
714a952d73
13 changed files with 200 additions and 90 deletions
|
@ -51,13 +51,14 @@ class EntityMapStorage:
|
|||
|
||||
async def async_initialize(self) -> None:
|
||||
"""Get the pairing cache data."""
|
||||
if not (raw_storage := cast(StorageLayout, await self.store.async_load())):
|
||||
if not (raw_storage := await self.store.async_load()):
|
||||
# There is no cached data about HomeKit devices yet
|
||||
return
|
||||
|
||||
self.storage_data = raw_storage.get("pairings", {})
|
||||
storage = cast(StorageLayout, raw_storage)
|
||||
self.storage_data = storage.get("pairings", {})
|
||||
|
||||
def get_map(self, homekit_id) -> Pairing | None:
|
||||
def get_map(self, homekit_id: str) -> Pairing | None:
|
||||
"""Get a pairing cache item."""
|
||||
return self.storage_data.get(homekit_id)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue