File: configuration.py

package info (click to toggle)
python-aiounifi 79-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 660 kB
  • sloc: python: 11,124; sh: 5; makefile: 5
file content (26 lines) | stat: -rw-r--r-- 599 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
"""Python library to enable integration between Home Assistant and UniFi."""

from dataclasses import KW_ONLY, dataclass
from ssl import SSLContext
from typing import Literal

from aiohttp import ClientSession


@dataclass
class Configuration:
    """Console configuration."""

    session: ClientSession
    host: str
    _: KW_ONLY
    username: str
    password: str
    port: int = 8443
    site: str = "default"
    ssl_context: SSLContext | Literal[False] = False

    @property
    def url(self) -> str:
        """Represent console path."""
        return f"https://{self.host}:{self.port}"