Speed up camera tokens (#73098)
This commit is contained in:
parent
35a0f59ec9
commit
f7626bd511
1 changed files with 1 additions and 4 deletions
|
@ -10,7 +10,6 @@ from dataclasses import dataclass
|
|||
from datetime import datetime, timedelta
|
||||
from enum import IntEnum
|
||||
from functools import partial
|
||||
import hashlib
|
||||
import logging
|
||||
import os
|
||||
from random import SystemRandom
|
||||
|
@ -675,9 +674,7 @@ class Camera(Entity):
|
|||
@callback
|
||||
def async_update_token(self) -> None:
|
||||
"""Update the used token."""
|
||||
self.access_tokens.append(
|
||||
hashlib.sha256(_RND.getrandbits(256).to_bytes(32, "little")).hexdigest()
|
||||
)
|
||||
self.access_tokens.append(hex(_RND.getrandbits(256))[2:])
|
||||
|
||||
async def async_internal_added_to_hass(self) -> None:
|
||||
"""Run when entity about to be added to hass."""
|
||||
|
|
Loading…
Add table
Reference in a new issue