Improve performance of generating non-cryptographically secure uuids (#41314)
This commit is contained in:
1 parent
451f27bba1
commit
8d5c124deb
6 files changed
+14
-17
No files matched your search
@@ -26,7 +26,7 @@ class AreaEntry:
|
||||
"""Area Registry Entry."""
|
||||
|
||||
name: Optional[str] = attr.ib(default=None)
|
||||
id: str = attr.ib(factory=uuid_util.uuid_v1mc_hex)
|
||||
id: str = attr.ib(factory=uuid_util.random_uuid_hex)
|
||||
|
||||
|
||||
class AreaRegistry:
|
||||
|
||||
@@ -73,7 +73,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(factory=uuid_util.uuid_v1mc_hex)
|
||||
id: str = attr.ib(factory=uuid_util.random_uuid_hex)
|
||||
# This value is not stored, just used to keep track of events to fire.
|
||||
is_new: bool = attr.ib(default=False)
|
||||
|
||||
|
||||
Reference in new issue
Block a user