Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.hassio.http Namespace Reference

Classes

class  HassIOView
 

Functions

ClientTimeout _get_timeout (str path)
 
dict[str, str] _response_header (aiohttp.ClientResponse response, str path)
 
bool should_compress (str content_type, str|None path=None)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
int MAX_UPLOAD_SIZE = 1024 * 1024 * 1024
 
 NO_COMPRESS
 
 NO_STORE
 
 NO_TIMEOUT
 
 PATHS_ADMIN
 
 PATHS_LOGS
 
 PATHS_NO_AUTH
 
 PATHS_NOT_ONBOARDED
 
dictionary RESPONSE_HEADERS_FILTER
 

Detailed Description

HTTP Support for Hass.io.

Function Documentation

◆ _get_timeout()

ClientTimeout homeassistant.components.hassio.http._get_timeout ( str  path)
private
Return timeout for a URL path.

Definition at line 258 of file http.py.

◆ _response_header()

dict[str, str] homeassistant.components.hassio.http._response_header ( aiohttp.ClientResponse  response,
str  path 
)
private
Create response header.

Definition at line 246 of file http.py.

◆ should_compress()

bool homeassistant.components.hassio.http.should_compress ( str  content_type,
str | None   path = None 
)
Return if we should compress a response.

Definition at line 265 of file http.py.

Variable Documentation

◆ _LOGGER

homeassistant.components.hassio.http._LOGGER = logging.getLogger(__name__)
private

Definition at line 36 of file http.py.

◆ MAX_UPLOAD_SIZE

int homeassistant.components.hassio.http.MAX_UPLOAD_SIZE = 1024 * 1024 * 1024

Definition at line 38 of file http.py.

◆ NO_COMPRESS

homeassistant.components.hassio.http.NO_COMPRESS
Initial value:
1 = re.compile(
2  r"^(?:"
3  r"|audio/logs/(follow|boots/-?\d+(/follow)?)"
4  r"|cli/logs/(follow|boots/-?\d+(/follow)?)"
5  r"|core/logs/(follow|boots/-?\d+(/follow)?)"
6  r"|dns/logs/(follow|boots/-?\d+(/follow)?)"
7  r"|host/logs/(follow|boots/-?\d+(/follow)?)"
8  r"|multicast/logs/(follow|boots/-?\d+(/follow)?)"
9  r"|observer/logs/(follow|boots/-?\d+(/follow)?)"
10  r"|supervisor/logs/(follow|boots/-?\d+(/follow)?)"
11  r"|addons/[^/]+/logs/(follow|boots/-?\d+(/follow)?)"
12  r")$"
13 )

Definition at line 99 of file http.py.

◆ NO_STORE

homeassistant.components.hassio.http.NO_STORE
Initial value:
1 = re.compile(
2  r"^(?:"
3  r"|app/entrypoint.js"
4  r")$"
5 )

Definition at line 92 of file http.py.

◆ NO_TIMEOUT

homeassistant.components.hassio.http.NO_TIMEOUT
Initial value:
1 = re.compile(
2  r"^(?:"
3  r"|backups/.+/full"
4  r"|backups/.+/partial"
5  r"|backups/[^/]+/(?:upload|download)"
6  r"|audio/logs/(follow|boots/-?\d+(/follow)?)"
7  r"|cli/logs/(follow|boots/-?\d+(/follow)?)"
8  r"|core/logs/(follow|boots/-?\d+(/follow)?)"
9  r"|dns/logs/(follow|boots/-?\d+(/follow)?)"
10  r"|host/logs/(follow|boots/-?\d+(/follow)?)"
11  r"|multicast/logs/(follow|boots/-?\d+(/follow)?)"
12  r"|observer/logs/(follow|boots/-?\d+(/follow)?)"
13  r"|supervisor/logs/(follow|boots/-?\d+(/follow)?)"
14  r"|addons/[^/]+/logs/(follow|boots/-?\d+(/follow)?)"
15  r")$"
16 )

Definition at line 40 of file http.py.

◆ PATHS_ADMIN

homeassistant.components.hassio.http.PATHS_ADMIN
Initial value:
1 = re.compile(
2  r"^(?:"
3  r"|backups/[a-f0-9]{8}(/info|/download|/restore/full|/restore/partial)?"
4  r"|backups/new/upload"
5  r"|audio/logs(/follow|/boots/-?\d+(/follow)?)?"
6  r"|cli/logs(/follow|/boots/-?\d+(/follow)?)?"
7  r"|core/logs(/follow|/boots/-?\d+(/follow)?)?"
8  r"|dns/logs(/follow|/boots/-?\d+(/follow)?)?"
9  r"|host/logs(/follow|/boots(/-?\d+(/follow)?)?)?"
10  r"|multicast/logs(/follow|/boots/-?\d+(/follow)?)?"
11  r"|observer/logs(/follow|/boots/-?\d+(/follow)?)?"
12  r"|supervisor/logs(/follow|/boots/-?\d+(/follow)?)?"
13  r"|addons/[^/]+/(changelog|documentation)"
14  r"|addons/[^/]+/logs(/follow|/boots/-?\d+(/follow)?)?"
15  r")$"
16 )

Definition at line 67 of file http.py.

◆ PATHS_LOGS

homeassistant.components.hassio.http.PATHS_LOGS
Initial value:
1 = re.compile(
2  r"^(?:"
3  r"|audio/logs(/follow|/boots/-?\d+(/follow)?)?"
4  r"|cli/logs(/follow|/boots/-?\d+(/follow)?)?"
5  r"|core/logs(/follow|/boots/-?\d+(/follow)?)?"
6  r"|dns/logs(/follow|/boots/-?\d+(/follow)?)?"
7  r"|host/logs(/follow|/boots/-?\d+(/follow)?)?"
8  r"|multicast/logs(/follow|/boots/-?\d+(/follow)?)?"
9  r"|observer/logs(/follow|/boots/-?\d+(/follow)?)?"
10  r"|supervisor/logs(/follow|/boots/-?\d+(/follow)?)?"
11  r"|addons/[^/]+/logs(/follow|/boots/-?\d+(/follow)?)?"
12  r")$"
13 )

Definition at line 113 of file http.py.

◆ PATHS_NO_AUTH

homeassistant.components.hassio.http.PATHS_NO_AUTH
Initial value:
1 = re.compile(
2  r"^(?:"
3  r"|app/.*"
4  r"|(store/)?addons/[^/]+/(logo|icon)"
5  r")$"
6 )

Definition at line 85 of file http.py.

◆ PATHS_NOT_ONBOARDED

homeassistant.components.hassio.http.PATHS_NOT_ONBOARDED
Initial value:
1 = re.compile(
2  r"^(?:"
3  r"|backups/[a-f0-9]{8}(/info|/new/upload|/download|/restore/full|/restore/partial)?"
4  r"|backups/new/upload"
5  r")$"
6 )

Definition at line 59 of file http.py.

◆ RESPONSE_HEADERS_FILTER

dictionary homeassistant.components.hassio.http.RESPONSE_HEADERS_FILTER
Initial value:
1 = {
2  TRANSFER_ENCODING,
3  CONTENT_LENGTH,
4  CONTENT_TYPE,
5  CONTENT_ENCODING,
6 }

Definition at line 129 of file http.py.