diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 905b07e..356bed2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -9,24 +9,16 @@ repos: - id: debug-statements - id: check-ast -- repo: https://github.com/psf/black - rev: 23.1.0 - hooks: - - id: black - -- repo: https://github.com/pycqa/flake8 - rev: 6.0.0 - hooks: - - id: flake8 -- repo: https://github.com/PyCQA/isort - rev: 5.12.0 +- repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.1.6 hooks: - - id: isort - additional_dependencies: [toml] + - id: ruff + args: [--fix, --exit-non-zero-on-fix] + - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.0.1 + rev: v1.7.1 hooks: - id: mypy additional_dependencies: [types-attrs] diff --git a/custom_components/upnp_availability/upnpstatustracker.py b/custom_components/upnp_availability/upnpstatustracker.py index 071519e..4ff0453 100644 --- a/custom_components/upnp_availability/upnpstatustracker.py +++ b/custom_components/upnp_availability/upnpstatustracker.py @@ -77,8 +77,8 @@ class Device: max_age = attr.ib(default=1800) - info = attr.ib(factory=dict) - icons = attr.ib(factory=list, repr=False) + info: Dict[str, str] = attr.ib(factory=dict) + icons: List[Icon] = attr.ib(factory=list, repr=False) expire_timer = attr.ib(default=None, repr=False) expire_callback = attr.ib(default=None, repr=False) @@ -144,7 +144,7 @@ def __init__( new_device_cb=None, state_changed_cb=None, max_age_override=None, - source_addresses=None + source_addresses=None, ): """Creates a status tracker.