2018-12-05 10:41:00 +00:00
|
|
|
"""Models for permissions."""
|
2021-03-25 20:09:06 +00:00
|
|
|
from __future__ import annotations
|
|
|
|
|
2018-12-05 10:41:00 +00:00
|
|
|
from typing import TYPE_CHECKING
|
|
|
|
|
|
|
|
import attr
|
|
|
|
|
|
|
|
if TYPE_CHECKING:
|
2021-03-02 08:02:04 +00:00
|
|
|
from homeassistant.helpers import (
|
2020-08-29 06:23:55 +00:00
|
|
|
device_registry as dev_reg,
|
|
|
|
entity_registry as ent_reg,
|
|
|
|
)
|
2018-12-05 10:41:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
@attr.s(slots=True)
|
|
|
|
class PermissionLookup:
|
|
|
|
"""Class to hold data for permission lookups."""
|
|
|
|
|
2021-03-25 20:09:06 +00:00
|
|
|
entity_registry: ent_reg.EntityRegistry = attr.ib()
|
|
|
|
device_registry: dev_reg.DeviceRegistry = attr.ib()
|