2018-12-05 10:41:00 +00:00
|
|
|
"""Models for permissions."""
|
|
|
|
from typing import TYPE_CHECKING
|
|
|
|
|
|
|
|
import attr
|
|
|
|
|
|
|
|
if TYPE_CHECKING:
|
|
|
|
# pylint: disable=unused-import
|
|
|
|
from homeassistant.helpers import ( # noqa
|
|
|
|
entity_registry as ent_reg,
|
|
|
|
)
|
2019-03-11 18:02:37 +00:00
|
|
|
from homeassistant.helpers import ( # noqa
|
|
|
|
device_registry as dev_reg,
|
|
|
|
)
|
2018-12-05 10:41:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
@attr.s(slots=True)
|
|
|
|
class PermissionLookup:
|
|
|
|
"""Class to hold data for permission lookups."""
|
|
|
|
|
|
|
|
entity_registry = attr.ib(type='ent_reg.EntityRegistry')
|
2019-03-11 18:02:37 +00:00
|
|
|
device_registry = attr.ib(type='dev_reg.DeviceRegistry')
|