mirror of
https://github.com/CCOSTAN/Home-AssistantConfig.git
synced 2025-09-15 16:09:40 +00:00
Updated HACS and also fixed Garadget #727
This commit is contained in:
0
config/custom_components/hacs/handler/__init__.py
Executable file → Normal file
0
config/custom_components/hacs/handler/__init__.py
Executable file → Normal file
10
config/custom_components/hacs/handler/download.py
Executable file → Normal file
10
config/custom_components/hacs/handler/download.py
Executable file → Normal file
@@ -7,15 +7,17 @@ import aiofiles
|
||||
import async_timeout
|
||||
from integrationhelper import Logger
|
||||
import backoff
|
||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||
from ..hacsbase.exceptions import HacsException
|
||||
|
||||
from custom_components.hacs.globals import get_hacs
|
||||
|
||||
|
||||
@backoff.on_exception(backoff.expo, Exception, max_tries=5)
|
||||
async def async_download_file(hass, url):
|
||||
async def async_download_file(url):
|
||||
"""
|
||||
Download files, and return the content.
|
||||
"""
|
||||
hacs = get_hacs()
|
||||
logger = Logger("hacs.download.downloader")
|
||||
if url is None:
|
||||
return
|
||||
@@ -28,8 +30,8 @@ async def async_download_file(hass, url):
|
||||
|
||||
result = None
|
||||
|
||||
with async_timeout.timeout(60, loop=hass.loop):
|
||||
request = await async_get_clientsession(hass).get(url)
|
||||
with async_timeout.timeout(60, loop=hacs.hass.loop):
|
||||
request = await hacs.session.get(url)
|
||||
|
||||
# Make sure that we got a valid result
|
||||
if request.status == 200:
|
||||
|
0
config/custom_components/hacs/handler/template.py
Executable file → Normal file
0
config/custom_components/hacs/handler/template.py
Executable file → Normal file
Reference in New Issue
Block a user