From 8c96fab90549079e5473eda528c3c75ee23a6a4e Mon Sep 17 00:00:00 2001 From: Dawid Rogaczewski <20227477+daroga0002@users.noreply.github.com> Date: Thu, 4 Apr 2024 11:09:51 +0200 Subject: [PATCH 1/5] reorg reorg --- .../tech/CONTRIBUTING.md => CONTRIBUTING.md | 0 README.md | 12 ++++++------ .../tech/images => images}/ha-tech-1.png | Bin .../tech/images => images}/ha-tech-2.png | Bin .../images => images}/ha-tech-add-integration-1.png | Bin .../images => images}/ha-tech-add-integration-2.png | Bin .../images => images}/ha-tech-add-integration-3.png | Bin .../images => images}/ha-tech-add-integration-4.png | Bin .../images => images}/ha-tech-add-integration.png | Bin .../tech/images => images}/ha-tech-devices.png | Bin .../tech/images => images}/ha-tech-logs-ex.png | Bin .../tech/images => images}/ha-tech-logs-ex2.png | Bin .../tech/images => images}/ha-tech-logs-ex3.png | Bin .../tech/images => images}/ha-tech-logs.png | Bin 14 files changed, 6 insertions(+), 6 deletions(-) rename custom_components/tech/CONTRIBUTING.md => CONTRIBUTING.md (100%) rename {custom_components/tech/images => images}/ha-tech-1.png (100%) rename {custom_components/tech/images => images}/ha-tech-2.png (100%) rename {custom_components/tech/images => images}/ha-tech-add-integration-1.png (100%) rename {custom_components/tech/images => images}/ha-tech-add-integration-2.png (100%) rename {custom_components/tech/images => images}/ha-tech-add-integration-3.png (100%) rename {custom_components/tech/images => images}/ha-tech-add-integration-4.png (100%) rename {custom_components/tech/images => images}/ha-tech-add-integration.png (100%) rename {custom_components/tech/images => images}/ha-tech-devices.png (100%) rename {custom_components/tech/images => images}/ha-tech-logs-ex.png (100%) rename {custom_components/tech/images => images}/ha-tech-logs-ex2.png (100%) rename {custom_components/tech/images => images}/ha-tech-logs-ex3.png (100%) rename {custom_components/tech/images => images}/ha-tech-logs.png (100%) 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/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 From f18bb35c093cd39062e2c2bef59066dd2121e597 Mon Sep 17 00:00:00 2001 From: Dawid Rogaczewski <20227477+daroga0002@users.noreply.github.com> Date: Thu, 4 Apr 2024 11:10:02 +0200 Subject: [PATCH 2/5] linting --- custom_components/tech/tech.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/custom_components/tech/tech.py b/custom_components/tech/tech.py index 1ac6fd8..8bfecdd 100644 --- a/custom_components/tech/tech.py +++ b/custom_components/tech/tech.py @@ -112,10 +112,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"] From 7284a7d7e6e1766f09a10bbfb03fdfb1673ac813 Mon Sep 17 00:00:00 2001 From: Dawid Rogaczewski <20227477+daroga0002@users.noreply.github.com> Date: Thu, 4 Apr 2024 10:50:17 +0000 Subject: [PATCH 3/5] update ruff and pre-commit --- .pre-commit-config.yaml | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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/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 From 24e08a706ec85b9f962d97458047e0c8fca96867 Mon Sep 17 00:00:00 2001 From: Dawid Rogaczewski <20227477+daroga0002@users.noreply.github.com> Date: Thu, 4 Apr 2024 10:50:40 +0000 Subject: [PATCH 4/5] lint --- .github/scripts/update_hacs_manifest.py | 1 + custom_components/tech/__init__.py | 1 + custom_components/tech/assets.py | 1 + custom_components/tech/binary_sensor.py | 1 + custom_components/tech/climate.py | 1 + custom_components/tech/config_flow.py | 1 + custom_components/tech/entity.py | 1 + custom_components/tech/sensor.py | 1 + custom_components/tech/tech.py | 1 + tests/common.py | 1 + tests/tests_api/conftest.py | 1 + tests/tests_api/test_api.py | 1 + 12 files changed, 12 insertions(+) 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/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 8bfecdd..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 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 From eec29cb9d0c4e6415188d3edcfa23adece0bf92d Mon Sep 17 00:00:00 2001 From: Dawid Rogaczewski <20227477+daroga0002@users.noreply.github.com> Date: Thu, 4 Apr 2024 11:00:04 +0000 Subject: [PATCH 5/5] remove rust from devcontainer --- .devcontainer.json | 1 - 1 file changed, 1 deletion(-) 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