mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 14:17:45 +00:00
Sort and simplify DeletedDeviceEntry (#145171)
* Sort and simplify DeletedDeviceEntry * Fix sort * Fix sort
This commit is contained in:
parent
eb4d561b96
commit
ce71f6444c
@ -397,11 +397,11 @@ class DeletedDeviceEntry:
|
||||
config_entries: set[str] = attr.ib()
|
||||
config_entries_subentries: dict[str, set[str | None]] = attr.ib()
|
||||
connections: set[tuple[str, str]] = attr.ib()
|
||||
identifiers: set[tuple[str, str]] = attr.ib()
|
||||
created_at: datetime = attr.ib()
|
||||
id: str = attr.ib()
|
||||
identifiers: set[tuple[str, str]] = attr.ib()
|
||||
modified_at: datetime = attr.ib()
|
||||
orphaned_timestamp: float | None = attr.ib()
|
||||
created_at: datetime = attr.ib(factory=utcnow)
|
||||
modified_at: datetime = attr.ib(factory=utcnow)
|
||||
_cache: dict[str, Any] = attr.ib(factory=dict, eq=False, init=False)
|
||||
|
||||
def to_device_entry(
|
||||
@ -440,8 +440,8 @@ class DeletedDeviceEntry:
|
||||
"created_at": self.created_at,
|
||||
"identifiers": list(self.identifiers),
|
||||
"id": self.id,
|
||||
"orphaned_timestamp": self.orphaned_timestamp,
|
||||
"modified_at": self.modified_at,
|
||||
"orphaned_timestamp": self.orphaned_timestamp,
|
||||
}
|
||||
)
|
||||
)
|
||||
@ -1244,6 +1244,7 @@ class DeviceRegistry(BaseRegistry[dict[str, list[dict[str, Any]]]]):
|
||||
created_at=device.created_at,
|
||||
identifiers=device.identifiers,
|
||||
id=device.id,
|
||||
modified_at=utcnow(),
|
||||
orphaned_timestamp=None,
|
||||
)
|
||||
for other_device in list(self.devices.values()):
|
||||
|
Loading…
x
Reference in New Issue
Block a user