Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.http.web_runner.HomeAssistantTCPSite Class Reference
Inheritance diagram for homeassistant.components.http.web_runner.HomeAssistantTCPSite:
[legend]
Collaboration diagram for homeassistant.components.http.web_runner.HomeAssistantTCPSite:
[legend]

Public Member Functions

None __init__ (self, web.BaseRunner runner, str|list[str]|None host, int port, *SSLContext|None ssl_context=None, int backlog=128, bool|None reuse_address=None, bool|None reuse_port=None)
 
str name (self)
 
None start (self)
 

Private Attributes

 _host
 
 _port
 
 _reuse_address
 
 _reuse_port
 
 _server
 

Static Private Attributes

tuple __slots__ = ("_host", "_port", "_reuse_address", "_reuse_port", "_hosturl")
 

Detailed Description

HomeAssistant specific aiohttp Site.

Vanilla TCPSite accepts only str as host. However, the underlying asyncio's
create_server() implementation does take a list of strings to bind to multiple
host IP's. To support multiple server_host entries (e.g. to enable dual-stack
explicitly), we would like to pass an array of strings. Bring our own
implementation inspired by TCPSite.

Custom TCPSite can be dropped when https://github.com/aio-libs/aiohttp/pull/4894
is merged.

Definition at line 12 of file web_runner.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.components.http.web_runner.HomeAssistantTCPSite.__init__ (   self,
web.BaseRunner  runner,
str | list[str] | None  host,
int  port,
*SSLContext | None   ssl_context = None,
int   backlog = 128,
bool | None   reuse_address = None,
bool | None   reuse_port = None 
)
Initialize HomeAssistantTCPSite.

Definition at line 27 of file web_runner.py.

Member Function Documentation

◆ name()

str homeassistant.components.http.web_runner.HomeAssistantTCPSite.name (   self)
Return server URL.

Definition at line 50 of file web_runner.py.

◆ start()

None homeassistant.components.http.web_runner.HomeAssistantTCPSite.start (   self)
Start server.

Definition at line 56 of file web_runner.py.

Member Data Documentation

◆ __slots__

tuple homeassistant.components.http.web_runner.HomeAssistantTCPSite.__slots__ = ("_host", "_port", "_reuse_address", "_reuse_port", "_hosturl")
staticprivate

Definition at line 25 of file web_runner.py.

◆ _host

homeassistant.components.http.web_runner.HomeAssistantTCPSite._host
private

Definition at line 44 of file web_runner.py.

◆ _port

homeassistant.components.http.web_runner.HomeAssistantTCPSite._port
private

Definition at line 45 of file web_runner.py.

◆ _reuse_address

homeassistant.components.http.web_runner.HomeAssistantTCPSite._reuse_address
private

Definition at line 46 of file web_runner.py.

◆ _reuse_port

homeassistant.components.http.web_runner.HomeAssistantTCPSite._reuse_port
private

Definition at line 47 of file web_runner.py.

◆ _server

homeassistant.components.http.web_runner.HomeAssistantTCPSite._server
private

Definition at line 62 of file web_runner.py.


The documentation for this class was generated from the following file: