mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-11 11:16:30 +00:00
Bump pre-commit ruff to 0.5.7 and reformat (#5242)
It seems that the codebase is not formatted with the latest ruff version. This PR reformats the codebase with ruff 0.5.7.
This commit is contained in:
parent
21ae2c2e54
commit
f6faa18409
@ -1,6 +1,6 @@
|
|||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||||
rev: v0.2.1
|
rev: v0.5.7
|
||||||
hooks:
|
hooks:
|
||||||
- id: ruff
|
- id: ruff
|
||||||
args:
|
args:
|
||||||
|
@ -228,7 +228,7 @@ filterwarnings = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[tool.ruff]
|
[tool.ruff]
|
||||||
select = [
|
lint.select = [
|
||||||
"B002", # Python does not support the unary prefix increment
|
"B002", # Python does not support the unary prefix increment
|
||||||
"B007", # Loop control variable {name} not used within loop body
|
"B007", # Loop control variable {name} not used within loop body
|
||||||
"B014", # Exception handler with duplicate exception
|
"B014", # Exception handler with duplicate exception
|
||||||
@ -291,7 +291,7 @@ select = [
|
|||||||
"W", # pycodestyle
|
"W", # pycodestyle
|
||||||
]
|
]
|
||||||
|
|
||||||
ignore = [
|
lint.ignore = [
|
||||||
"D202", # No blank lines allowed after function docstring
|
"D202", # No blank lines allowed after function docstring
|
||||||
"D203", # 1 blank line required before class docstring
|
"D203", # 1 blank line required before class docstring
|
||||||
"D213", # Multi-line docstring summary should start at the second line
|
"D213", # Multi-line docstring summary should start at the second line
|
||||||
@ -338,16 +338,16 @@ ignore = [
|
|||||||
"PLE0605",
|
"PLE0605",
|
||||||
]
|
]
|
||||||
|
|
||||||
[tool.ruff.flake8-import-conventions.extend-aliases]
|
[tool.ruff.lint.flake8-import-conventions.extend-aliases]
|
||||||
voluptuous = "vol"
|
voluptuous = "vol"
|
||||||
|
|
||||||
[tool.ruff.flake8-pytest-style]
|
[tool.ruff.lint.flake8-pytest-style]
|
||||||
fixture-parentheses = false
|
fixture-parentheses = false
|
||||||
|
|
||||||
[tool.ruff.flake8-tidy-imports.banned-api]
|
[tool.ruff.lint.flake8-tidy-imports.banned-api]
|
||||||
"pytz".msg = "use zoneinfo instead"
|
"pytz".msg = "use zoneinfo instead"
|
||||||
|
|
||||||
[tool.ruff.isort]
|
[tool.ruff.lint.isort]
|
||||||
force-sort-within-sections = true
|
force-sort-within-sections = true
|
||||||
section-order = [
|
section-order = [
|
||||||
"future",
|
"future",
|
||||||
@ -361,10 +361,10 @@ known-first-party = ["supervisor", "tests"]
|
|||||||
combine-as-imports = true
|
combine-as-imports = true
|
||||||
split-on-trailing-comma = false
|
split-on-trailing-comma = false
|
||||||
|
|
||||||
[tool.ruff.per-file-ignores]
|
[tool.ruff.lint.per-file-ignores]
|
||||||
|
|
||||||
# DBus Service Mocks must use typing and names understood by dbus-fast
|
# DBus Service Mocks must use typing and names understood by dbus-fast
|
||||||
"tests/dbus_service_mocks/*.py" = ["F722", "F821", "N815"]
|
"tests/dbus_service_mocks/*.py" = ["F722", "F821", "N815"]
|
||||||
|
|
||||||
[tool.ruff.mccabe]
|
[tool.ruff.lint.mccabe]
|
||||||
max-complexity = 25
|
max-complexity = 25
|
||||||
|
1
setup.py
1
setup.py
@ -1,4 +1,5 @@
|
|||||||
"""Home Assistant Supervisor setup."""
|
"""Home Assistant Supervisor setup."""
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Main file for Supervisor."""
|
"""Main file for Supervisor."""
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from concurrent.futures import ThreadPoolExecutor
|
from concurrent.futures import ThreadPoolExecutor
|
||||||
import logging
|
import logging
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Init file for Supervisor add-ons."""
|
"""Init file for Supervisor add-ons."""
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from collections.abc import Awaitable
|
from collections.abc import Awaitable
|
||||||
from contextlib import suppress
|
from contextlib import suppress
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Supervisor add-on build environment."""
|
"""Supervisor add-on build environment."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from functools import cached_property
|
from functools import cached_property
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Add-on static data."""
|
"""Add-on static data."""
|
||||||
|
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from enum import StrEnum
|
from enum import StrEnum
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Init file for Supervisor add-on data."""
|
"""Init file for Supervisor add-on data."""
|
||||||
|
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Supervisor add-on manager."""
|
"""Supervisor add-on manager."""
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from collections.abc import Awaitable
|
from collections.abc import Awaitable
|
||||||
from contextlib import suppress
|
from contextlib import suppress
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Init file for Supervisor add-ons."""
|
"""Init file for Supervisor add-ons."""
|
||||||
|
|
||||||
from abc import ABC, abstractmethod
|
from abc import ABC, abstractmethod
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from collections.abc import Awaitable, Callable
|
from collections.abc import Awaitable, Callable
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Add-on Options / UI rendering."""
|
"""Add-on Options / UI rendering."""
|
||||||
|
|
||||||
import hashlib
|
import hashlib
|
||||||
import logging
|
import logging
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Util add-ons functions."""
|
"""Util add-ons functions."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Validate add-ons options schema."""
|
"""Validate add-ons options schema."""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
import secrets
|
import secrets
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Init file for Supervisor Audio RESTful API."""
|
"""Init file for Supervisor Audio RESTful API."""
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from collections.abc import Awaitable
|
from collections.abc import Awaitable
|
||||||
from dataclasses import asdict
|
from dataclasses import asdict
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Init file for Supervisor auth/SSO RESTful API."""
|
"""Init file for Supervisor auth/SSO RESTful API."""
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import logging
|
import logging
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Backups RESTful API."""
|
"""Backups RESTful API."""
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from collections.abc import Callable
|
from collections.abc import Callable
|
||||||
import errno
|
import errno
|
||||||
@ -342,9 +343,9 @@ class APIBackups(CoreSysAttributes):
|
|||||||
_LOGGER.info("Downloading backup %s", backup.slug)
|
_LOGGER.info("Downloading backup %s", backup.slug)
|
||||||
response = web.FileResponse(backup.tarfile)
|
response = web.FileResponse(backup.tarfile)
|
||||||
response.content_type = CONTENT_TYPE_TAR
|
response.content_type = CONTENT_TYPE_TAR
|
||||||
response.headers[
|
response.headers[CONTENT_DISPOSITION] = (
|
||||||
CONTENT_DISPOSITION
|
f"attachment; filename={RE_SLUGIFY_NAME.sub('_', backup.name)}.tar"
|
||||||
] = f"attachment; filename={RE_SLUGIFY_NAME.sub('_', backup.name)}.tar"
|
)
|
||||||
return response
|
return response
|
||||||
|
|
||||||
@api_process
|
@api_process
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Init file for Supervisor HA cli RESTful API."""
|
"""Init file for Supervisor HA cli RESTful API."""
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import logging
|
import logging
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Init file for Supervisor network RESTful API."""
|
"""Init file for Supervisor network RESTful API."""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Init file for Supervisor DNS RESTful API."""
|
"""Init file for Supervisor DNS RESTful API."""
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from collections.abc import Awaitable
|
from collections.abc import Awaitable
|
||||||
import logging
|
import logging
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Init file for Supervisor Home Assistant RESTful API."""
|
"""Init file for Supervisor Home Assistant RESTful API."""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Init file for Supervisor hardware RESTful API."""
|
"""Init file for Supervisor hardware RESTful API."""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Supervisor Add-on ingress service."""
|
"""Supervisor Add-on ingress service."""
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from ipaddress import ip_address
|
from ipaddress import ip_address
|
||||||
import logging
|
import logging
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Init file for Supervisor Jobs RESTful API."""
|
"""Init file for Supervisor Jobs RESTful API."""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Init file for Supervisor Multicast RESTful API."""
|
"""Init file for Supervisor Multicast RESTful API."""
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from collections.abc import Awaitable
|
from collections.abc import Awaitable
|
||||||
import logging
|
import logging
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""REST API for network."""
|
"""REST API for network."""
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from collections.abc import Awaitable
|
from collections.abc import Awaitable
|
||||||
from dataclasses import replace
|
from dataclasses import replace
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Init file for Supervisor Observer RESTful API."""
|
"""Init file for Supervisor Observer RESTful API."""
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import logging
|
import logging
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Init file for Supervisor HassOS RESTful API."""
|
"""Init file for Supervisor HassOS RESTful API."""
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from collections.abc import Awaitable
|
from collections.abc import Awaitable
|
||||||
import logging
|
import logging
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Utils for Home Assistant Proxy."""
|
"""Utils for Home Assistant Proxy."""
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from contextlib import asynccontextmanager
|
from contextlib import asynccontextmanager
|
||||||
import logging
|
import logging
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Handle REST API for resoulution."""
|
"""Handle REST API for resoulution."""
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from collections.abc import Awaitable
|
from collections.abc import Awaitable
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Init file for Supervisor Root RESTful API."""
|
"""Init file for Supervisor Root RESTful API."""
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import logging
|
import logging
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Init file for Supervisor Security RESTful API."""
|
"""Init file for Supervisor Security RESTful API."""
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import logging
|
import logging
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Init file for Supervisor Home Assistant RESTful API."""
|
"""Init file for Supervisor Home Assistant RESTful API."""
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from collections.abc import Awaitable
|
from collections.abc import Awaitable
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Init file for Supervisor Supervisor RESTful API."""
|
"""Init file for Supervisor Supervisor RESTful API."""
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from collections.abc import Awaitable
|
from collections.abc import Awaitable
|
||||||
import logging
|
import logging
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Init file for Supervisor util for RESTful API."""
|
"""Init file for Supervisor util for RESTful API."""
|
||||||
|
|
||||||
import json
|
import json
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Handle Arch for underlay maschine/platforms."""
|
"""Handle Arch for underlay maschine/platforms."""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import platform
|
import platform
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Manage SSO for Add-ons with Home Assistant user."""
|
"""Manage SSO for Add-ons with Home Assistant user."""
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import hashlib
|
import hashlib
|
||||||
import logging
|
import logging
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Representation of a backup file."""
|
"""Representation of a backup file."""
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from base64 import b64decode, b64encode
|
from base64 import b64decode, b64encode
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Backup consts."""
|
"""Backup consts."""
|
||||||
|
|
||||||
from enum import StrEnum
|
from enum import StrEnum
|
||||||
|
|
||||||
BUF_SIZE = 2**20 * 4 # 4MB
|
BUF_SIZE = 2**20 * 4 # 4MB
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Util add-on functions."""
|
"""Util add-on functions."""
|
||||||
|
|
||||||
import hashlib
|
import hashlib
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Validate some things around restore."""
|
"""Validate some things around restore."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
"""Bootstrap Supervisor."""
|
"""Bootstrap Supervisor."""
|
||||||
|
|
||||||
|
# ruff: noqa: T100
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Bus event system."""
|
"""Bus event system."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from collections.abc import Awaitable, Callable
|
from collections.abc import Awaitable, Callable
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Bootstrap Supervisor."""
|
"""Bootstrap Supervisor."""
|
||||||
|
|
||||||
from datetime import UTC, datetime
|
from datetime import UTC, datetime
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Constants file for Supervisor."""
|
"""Constants file for Supervisor."""
|
||||||
|
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from enum import StrEnum
|
from enum import StrEnum
|
||||||
from ipaddress import ip_network
|
from ipaddress import ip_network
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Main file for Supervisor."""
|
"""Main file for Supervisor."""
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from collections.abc import Awaitable
|
from collections.abc import Awaitable
|
||||||
from contextlib import suppress
|
from contextlib import suppress
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Handle core shared data."""
|
"""Handle core shared data."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""OS-Agent implementation for DBUS."""
|
"""OS-Agent implementation for DBUS."""
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from collections.abc import Awaitable
|
from collections.abc import Awaitable
|
||||||
import logging
|
import logging
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""AppArmor object for OS-Agent."""
|
"""AppArmor object for OS-Agent."""
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from awesomeversion import AwesomeVersion
|
from awesomeversion import AwesomeVersion
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Board management for OS Agent."""
|
"""Board management for OS Agent."""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from dbus_fast.aio.message_bus import MessageBus
|
from dbus_fast.aio.message_bus import MessageBus
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""DataDisk object for OS-Agent."""
|
"""DataDisk object for OS-Agent."""
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from ..const import (
|
from ..const import (
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Constants for DBUS."""
|
"""Constants for DBUS."""
|
||||||
|
|
||||||
from enum import IntEnum, StrEnum
|
from enum import IntEnum, StrEnum
|
||||||
from socket import AF_INET, AF_INET6
|
from socket import AF_INET, AF_INET6
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""D-Bus interface for hostname."""
|
"""D-Bus interface for hostname."""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from dbus_fast.aio.message_bus import MessageBus
|
from dbus_fast.aio.message_bus import MessageBus
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Interface class for D-Bus wrappers."""
|
"""Interface class for D-Bus wrappers."""
|
||||||
|
|
||||||
from abc import ABC
|
from abc import ABC
|
||||||
from collections.abc import Callable
|
from collections.abc import Callable
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Interface to Logind over D-Bus."""
|
"""Interface to Logind over D-Bus."""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from dbus_fast.aio.message_bus import MessageBus
|
from dbus_fast.aio.message_bus import MessageBus
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""D-Bus interface objects."""
|
"""D-Bus interface objects."""
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Network Manager implementation for DBUS."""
|
"""Network Manager implementation for DBUS."""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""NetworkConnection objects for Network Manager."""
|
"""NetworkConnection objects for Network Manager."""
|
||||||
|
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from ipaddress import IPv4Address, IPv6Address
|
from ipaddress import IPv4Address, IPv6Address
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Network Manager DNS Manager object."""
|
"""Network Manager DNS Manager object."""
|
||||||
|
|
||||||
from ipaddress import ip_address
|
from ipaddress import ip_address
|
||||||
import logging
|
import logging
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Connection object for Network Manager."""
|
"""Connection object for Network Manager."""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Payload generators for DBUS communication."""
|
"""Payload generators for DBUS communication."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import socket
|
import socket
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Network Manager implementation for DBUS."""
|
"""Network Manager implementation for DBUS."""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Wireless object for Network Manager."""
|
"""Wireless object for Network Manager."""
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import logging
|
import logging
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""D-Bus interface for systemd-resolved."""
|
"""D-Bus interface for systemd-resolved."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Interface to systemd-timedate over D-Bus."""
|
"""Interface to systemd-timedate over D-Bus."""
|
||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Interface to UDisks2 over D-Bus."""
|
"""Interface to UDisks2 over D-Bus."""
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import logging
|
import logging
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Interface to UDisks2 Block Device over D-Bus."""
|
"""Interface to UDisks2 Block Device over D-Bus."""
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from collections.abc import Callable
|
from collections.abc import Callable
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Handle discover message for Home Assistant."""
|
"""Handle discover message for Home Assistant."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from contextlib import suppress
|
from contextlib import suppress
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Init file for Supervisor add-on Docker object."""
|
"""Init file for Supervisor add-on Docker object."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from collections.abc import Awaitable
|
from collections.abc import Awaitable
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Audio docker object."""
|
"""Audio docker object."""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import docker
|
import docker
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""HA Cli docker object."""
|
"""HA Cli docker object."""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from ..coresys import CoreSysAttributes
|
from ..coresys import CoreSysAttributes
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Docker constants."""
|
"""Docker constants."""
|
||||||
|
|
||||||
from enum import StrEnum
|
from enum import StrEnum
|
||||||
|
|
||||||
from docker.types import Mount
|
from docker.types import Mount
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""DNS docker object."""
|
"""DNS docker object."""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from docker.types import Mount
|
from docker.types import Mount
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Init file for Supervisor Docker object."""
|
"""Init file for Supervisor Docker object."""
|
||||||
|
|
||||||
from collections.abc import Awaitable
|
from collections.abc import Awaitable
|
||||||
from ipaddress import IPv4Address
|
from ipaddress import IPv4Address
|
||||||
import logging
|
import logging
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Interface class for Supervisor Docker object."""
|
"""Interface class for Supervisor Docker object."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Manager for Supervisor Docker."""
|
"""Manager for Supervisor Docker."""
|
||||||
|
|
||||||
from contextlib import suppress
|
from contextlib import suppress
|
||||||
from ipaddress import IPv4Address
|
from ipaddress import IPv4Address
|
||||||
import logging
|
import logging
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""HA Cli docker object."""
|
"""HA Cli docker object."""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from ..coresys import CoreSysAttributes
|
from ..coresys import CoreSysAttributes
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Internal network manager for Supervisor."""
|
"""Internal network manager for Supervisor."""
|
||||||
|
|
||||||
from contextlib import suppress
|
from contextlib import suppress
|
||||||
from ipaddress import IPv4Address
|
from ipaddress import IPv4Address
|
||||||
import logging
|
import logging
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Observer docker object."""
|
"""Observer docker object."""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from ..const import DOCKER_NETWORK_MASK
|
from ..const import DOCKER_NETWORK_MASK
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Calc and represent docker stats data."""
|
"""Calc and represent docker stats data."""
|
||||||
|
|
||||||
from contextlib import suppress
|
from contextlib import suppress
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Init file for Supervisor Docker object."""
|
"""Init file for Supervisor Docker object."""
|
||||||
|
|
||||||
from collections.abc import Awaitable
|
from collections.abc import Awaitable
|
||||||
from ipaddress import IPv4Address
|
from ipaddress import IPv4Address
|
||||||
import logging
|
import logging
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Constants for hardware."""
|
"""Constants for hardware."""
|
||||||
|
|
||||||
from enum import StrEnum
|
from enum import StrEnum
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Data representation of Hardware."""
|
"""Data representation of Hardware."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Read disk hardware info from system."""
|
"""Read disk hardware info from system."""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import shutil
|
import shutil
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Read hardware info from system."""
|
"""Read hardware info from system."""
|
||||||
|
|
||||||
from datetime import UTC, datetime
|
from datetime import UTC, datetime
|
||||||
import logging
|
import logging
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Hardware Manager of Supervisor."""
|
"""Hardware Manager of Supervisor."""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Supervisor Hardware monitor based on udev."""
|
"""Supervisor Hardware monitor based on udev."""
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import logging
|
import logging
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Policy / cgroups management of local host."""
|
"""Policy / cgroups management of local host."""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from ..coresys import CoreSys, CoreSysAttributes
|
from ..coresys import CoreSys, CoreSysAttributes
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Home Assistant control object."""
|
"""Home Assistant control object."""
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from contextlib import AbstractAsyncContextManager, asynccontextmanager, suppress
|
from contextlib import AbstractAsyncContextManager, asynccontextmanager, suppress
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Constants for homeassistant."""
|
"""Constants for homeassistant."""
|
||||||
|
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from enum import StrEnum
|
from enum import StrEnum
|
||||||
from pathlib import PurePath
|
from pathlib import PurePath
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Home Assistant control object."""
|
"""Home Assistant control object."""
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from collections.abc import Awaitable
|
from collections.abc import Awaitable
|
||||||
from contextlib import suppress
|
from contextlib import suppress
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Handle Home Assistant secrets to add-ons."""
|
"""Handle Home Assistant secrets to add-ons."""
|
||||||
|
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
import logging
|
import logging
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Validate functions."""
|
"""Validate functions."""
|
||||||
|
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Home Assistant Websocket API."""
|
"""Home Assistant Websocket API."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""AppArmor control for host."""
|
"""AppArmor control for host."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from contextlib import suppress
|
from contextlib import suppress
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Const for host."""
|
"""Const for host."""
|
||||||
|
|
||||||
from enum import StrEnum
|
from enum import StrEnum
|
||||||
|
|
||||||
PARAM_BOOT_ID = "_BOOT_ID"
|
PARAM_BOOT_ID = "_BOOT_ID"
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Power control for host."""
|
"""Power control for host."""
|
||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Info control for host."""
|
"""Info control for host."""
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import logging
|
import logging
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Logs control for host."""
|
"""Logs control for host."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from contextlib import asynccontextmanager
|
from contextlib import asynccontextmanager
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Host function like audio, D-Bus or systemd."""
|
"""Host function like audio, D-Bus or systemd."""
|
||||||
|
|
||||||
from contextlib import suppress
|
from contextlib import suppress
|
||||||
from functools import lru_cache
|
from functools import lru_cache
|
||||||
import logging
|
import logging
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Info control for host."""
|
"""Info control for host."""
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from contextlib import suppress
|
from contextlib import suppress
|
||||||
import logging
|
import logging
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user