Remove no longer needed auth.util, use secrets instead (#29861)

This commit is contained in:
Ville Skyttä authored and Paulus Schoutsen committed 2019-12-12 16:46:33 +01:00
1 parent c58c10ab7c
commit 130571c478
11 files changed
+24 -34

No files matched your search

+2 -2
View File
@@ -1,10 +1,10 @@
"""Provide functionality to stream video source."""
import logging
import secrets
import threading
import voluptuous as vol
from homeassistant.auth.util import generate_secret
from homeassistant.const import CONF_FILENAME, EVENT_HOMEASSISTANT_STOP
from homeassistant.core import callback
from homeassistant.exceptions import HomeAssistantError
@@ -72,7 +72,7 @@ def request_stream(hass, stream_source, *, fmt="hls", keepalive=False, options=N
stream.add_provider(fmt)
if not stream.access_token:
stream.access_token = generate_secret()
stream.access_token = secrets.token_hex()
stream.start()
return hass.data[DOMAIN][ATTR_ENDPOINTS][fmt].format(stream.access_token)
except Exception: