mirror of
https://github.com/esphome/aioesphomeapi.git
synced 2024-11-23 12:15:13 +01:00
Cache uuid conversions (#524)
This commit is contained in:
parent
eebc7d99f2
commit
81dad013d5
@ -849,7 +849,12 @@ class UserService(APIModelBase):
|
|||||||
|
|
||||||
def _join_split_uuid(value: list[int]) -> str:
|
def _join_split_uuid(value: list[int]) -> str:
|
||||||
"""Convert a high/low uuid into a single string."""
|
"""Convert a high/low uuid into a single string."""
|
||||||
return str(UUID(int=(value[0] << 64) | value[1]))
|
return _join_split_uuid_high_low(value[0], value[1])
|
||||||
|
|
||||||
|
|
||||||
|
@lru_cache(maxsize=256)
|
||||||
|
def _join_split_uuid_high_low(high: int, low: int) -> str:
|
||||||
|
return str(UUID(int=(high << 64) | low))
|
||||||
|
|
||||||
|
|
||||||
def _uuid_converter(uuid: str) -> str:
|
def _uuid_converter(uuid: str) -> str:
|
||||||
|
Loading…
Reference in New Issue
Block a user