diff --git a/.devcontainer.json b/.devcontainer.json index 95f82a3..150e1a9 100644 --- a/.devcontainer.json +++ b/.devcontainer.json @@ -38,6 +38,5 @@ }, "remoteUser": "vscode", "features": { - "ghcr.io/devcontainers/features/rust:1": {} } } \ No newline at end of file diff --git a/.github/scripts/update_hacs_manifest.py b/.github/scripts/update_hacs_manifest.py index 193d624..db59a53 100644 --- a/.github/scripts/update_hacs_manifest.py +++ b/.github/scripts/update_hacs_manifest.py @@ -1,4 +1,5 @@ """Update the manifest file.""" + import json import os import sys diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ddcbf27..88405cc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.2.2 + rev: v0.3.5 hooks: # Run the linter. - id: ruff diff --git a/custom_components/tech/CONTRIBUTING.md b/CONTRIBUTING.md similarity index 100% rename from custom_components/tech/CONTRIBUTING.md rename to CONTRIBUTING.md diff --git a/README.md b/README.md index 2942635..7267ee9 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Platform | Description `sensor` | Show info and status from Tech API. `climate` | Thermostats. -![Tech Thermostat Cards](/custom_components/tech/images/ha-tech-1.png) +![Tech Thermostat Cards](./images/ha-tech-1.png) ## :pencil2: Plans for development @@ -71,15 +71,15 @@ Platform | Description 1. You should see "Success!" dialog with the name of the imported controller(s). 1. Now you should have Climate entities representing your home zones available in Home Assistant. Go to your UI Lovelace configuration and add Thermostat card with your Climate entities. -![Tech Controllers Setup 1](/custom_components/tech/images/ha-tech-add-integration-1.png) +![Tech Controllers Setup 1](./images/ha-tech-add-integration-1.png) -![Tech Controllers Setup 2](/custom_components/tech/images/ha-tech-add-integration-2.png) +![Tech Controllers Setup 2](./images/ha-tech-add-integration-2.png) -![Tech Controllers Setup 3](/custom_components/tech/images/ha-tech-add-integration-3.png) +![Tech Controllers Setup 3](./images/ha-tech-add-integration-3.png) -![Tech Controllers Setup 3](/custom_components/tech/images/ha-tech-add-integration-4.png) +![Tech Controllers Setup 3](./images/ha-tech-add-integration-4.png) -![Tech Controllers Setup 4](/custom_components/tech/images/ha-tech-2.png) +![Tech Controllers Setup 4](./images/ha-tech-2.png) ## :arrow_up: Migration to version 2 diff --git a/custom_components/tech/__init__.py b/custom_components/tech/__init__.py index e5a1111..2fde72a 100644 --- a/custom_components/tech/__init__.py +++ b/custom_components/tech/__init__.py @@ -1,4 +1,5 @@ """The Tech Controllers integration.""" + import asyncio import logging import re diff --git a/custom_components/tech/assets.py b/custom_components/tech/assets.py index d80534c..cd6782d 100644 --- a/custom_components/tech/assets.py +++ b/custom_components/tech/assets.py @@ -1,4 +1,5 @@ """Assets for translations.""" + import logging from .const import DEFAULT_ICON, ICON_BY_ID, ICON_BY_TYPE, TXT_ID_BY_TYPE diff --git a/custom_components/tech/binary_sensor.py b/custom_components/tech/binary_sensor.py index cdd00c0..433d3cb 100644 --- a/custom_components/tech/binary_sensor.py +++ b/custom_components/tech/binary_sensor.py @@ -1,4 +1,5 @@ """Platform for binary sensor integration.""" + import logging from homeassistant.components import binary_sensor diff --git a/custom_components/tech/climate.py b/custom_components/tech/climate.py index 4c24744..10b9270 100644 --- a/custom_components/tech/climate.py +++ b/custom_components/tech/climate.py @@ -1,4 +1,5 @@ """Support for Tech HVAC system.""" + import logging from typing import Any, Optional diff --git a/custom_components/tech/config_flow.py b/custom_components/tech/config_flow.py index f521be4..9f37c39 100644 --- a/custom_components/tech/config_flow.py +++ b/custom_components/tech/config_flow.py @@ -1,4 +1,5 @@ """Config flow for Tech Sterowniki integration.""" + import logging from typing import List import uuid diff --git a/custom_components/tech/entity.py b/custom_components/tech/entity.py index 4ca627d..f197be1 100644 --- a/custom_components/tech/entity.py +++ b/custom_components/tech/entity.py @@ -1,4 +1,5 @@ """TileEntity.""" + from abc import abstractmethod import logging from typing import Any diff --git a/custom_components/tech/sensor.py b/custom_components/tech/sensor.py index 02c67d1..dcc8a50 100644 --- a/custom_components/tech/sensor.py +++ b/custom_components/tech/sensor.py @@ -1,4 +1,5 @@ """Support for Tech HVAC system.""" + import itertools import logging from typing import Any, Dict diff --git a/custom_components/tech/tech.py b/custom_components/tech/tech.py index 1ac6fd8..35b71c1 100644 --- a/custom_components/tech/tech.py +++ b/custom_components/tech/tech.py @@ -1,4 +1,5 @@ """Python wrapper for getting interaction with Tech devices.""" + import asyncio import json import logging @@ -112,10 +113,7 @@ async def authenticate(self, username, password): """ path = "authentication" - post_data = json.dumps({ - "username": username, - "password": password - }) + post_data = json.dumps({"username": username, "password": password}) try: result = await self.post(path, post_data) self.authenticated = result["authenticated"] diff --git a/custom_components/tech/images/ha-tech-1.png b/images/ha-tech-1.png similarity index 100% rename from custom_components/tech/images/ha-tech-1.png rename to images/ha-tech-1.png diff --git a/custom_components/tech/images/ha-tech-2.png b/images/ha-tech-2.png similarity index 100% rename from custom_components/tech/images/ha-tech-2.png rename to images/ha-tech-2.png diff --git a/custom_components/tech/images/ha-tech-add-integration-1.png b/images/ha-tech-add-integration-1.png similarity index 100% rename from custom_components/tech/images/ha-tech-add-integration-1.png rename to images/ha-tech-add-integration-1.png diff --git a/custom_components/tech/images/ha-tech-add-integration-2.png b/images/ha-tech-add-integration-2.png similarity index 100% rename from custom_components/tech/images/ha-tech-add-integration-2.png rename to images/ha-tech-add-integration-2.png diff --git a/custom_components/tech/images/ha-tech-add-integration-3.png b/images/ha-tech-add-integration-3.png similarity index 100% rename from custom_components/tech/images/ha-tech-add-integration-3.png rename to images/ha-tech-add-integration-3.png diff --git a/custom_components/tech/images/ha-tech-add-integration-4.png b/images/ha-tech-add-integration-4.png similarity index 100% rename from custom_components/tech/images/ha-tech-add-integration-4.png rename to images/ha-tech-add-integration-4.png diff --git a/custom_components/tech/images/ha-tech-add-integration.png b/images/ha-tech-add-integration.png similarity index 100% rename from custom_components/tech/images/ha-tech-add-integration.png rename to images/ha-tech-add-integration.png diff --git a/custom_components/tech/images/ha-tech-devices.png b/images/ha-tech-devices.png similarity index 100% rename from custom_components/tech/images/ha-tech-devices.png rename to images/ha-tech-devices.png diff --git a/custom_components/tech/images/ha-tech-logs-ex.png b/images/ha-tech-logs-ex.png similarity index 100% rename from custom_components/tech/images/ha-tech-logs-ex.png rename to images/ha-tech-logs-ex.png diff --git a/custom_components/tech/images/ha-tech-logs-ex2.png b/images/ha-tech-logs-ex2.png similarity index 100% rename from custom_components/tech/images/ha-tech-logs-ex2.png rename to images/ha-tech-logs-ex2.png diff --git a/custom_components/tech/images/ha-tech-logs-ex3.png b/images/ha-tech-logs-ex3.png similarity index 100% rename from custom_components/tech/images/ha-tech-logs-ex3.png rename to images/ha-tech-logs-ex3.png diff --git a/custom_components/tech/images/ha-tech-logs.png b/images/ha-tech-logs.png similarity index 100% rename from custom_components/tech/images/ha-tech-logs.png rename to images/ha-tech-logs.png diff --git a/requirements.txt b/requirements.txt index 76b813a..0272aa9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ colorlog==6.7.0 homeassistant>=2024.3.0 pip>=21.0,<23.2 -ruff==0.2.2 +ruff==0.3.5 pre-commit diff --git a/tests/common.py b/tests/common.py index 603c5d6..b66bd0c 100644 --- a/tests/common.py +++ b/tests/common.py @@ -1,4 +1,5 @@ """Common helpers.""" + import pathlib diff --git a/tests/tests_api/conftest.py b/tests/tests_api/conftest.py index 03bc006..8df2adf 100644 --- a/tests/tests_api/conftest.py +++ b/tests/tests_api/conftest.py @@ -1,4 +1,5 @@ """pytest fixtures.""" + from collections.abc import AsyncGenerator import json diff --git a/tests/tests_api/test_api.py b/tests/tests_api/test_api.py index 0cdaf5b..900e312 100644 --- a/tests/tests_api/test_api.py +++ b/tests/tests_api/test_api.py @@ -4,6 +4,7 @@ (username: "test", password: "test"). """ + import json import logging from unittest.mock import AsyncMock, patch