1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Attrs cleanups (#37849)

This commit is contained in:
Ville Skyttä
2020-07-14 20:30:30 +03:00
committed by GitHub
parent 7e280e2b27
commit ac0dbb17af
22 changed files with 141 additions and 148 deletions

View File

@@ -57,13 +57,9 @@ class DeletedDeviceEntry:
class DeviceEntry:
"""Device Registry Entry."""
config_entries: Set[str] = attr.ib(converter=set, default=attr.Factory(set))
connections: Set[Tuple[str, str]] = attr.ib(
converter=set, default=attr.Factory(set)
)
identifiers: Set[Tuple[str, str]] = attr.ib(
converter=set, default=attr.Factory(set)
)
config_entries: Set[str] = attr.ib(converter=set, factory=set)
connections: Set[Tuple[str, str]] = attr.ib(converter=set, factory=set)
identifiers: Set[Tuple[str, str]] = attr.ib(converter=set, factory=set)
manufacturer: str = attr.ib(default=None)
model: str = attr.ib(default=None)
name: str = attr.ib(default=None)
@@ -72,7 +68,7 @@ class DeviceEntry:
area_id: str = attr.ib(default=None)
name_by_user: str = attr.ib(default=None)
entry_type: str = attr.ib(default=None)
id: str = attr.ib(default=attr.Factory(lambda: uuid.uuid4().hex))
id: str = attr.ib(factory=lambda: uuid.uuid4().hex)
# This value is not stored, just used to keep track of events to fire.
is_new: bool = attr.ib(default=False)