diff --git a/.github/workflows/hassfest.yaml b/.github/workflows/hassfest.yaml new file mode 100644 index 0000000..26273a8 --- /dev/null +++ b/.github/workflows/hassfest.yaml @@ -0,0 +1,19 @@ +name: Validate (hassfest) + +on: + push: + pull_request: + schedule: + - cron: "0 0 * * *" + workflow_dispatch: + +permissions: {} + +jobs: + validate-hassfest: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: hassfest + uses: home-assistant/actions/hassfest@master diff --git a/.github/workflows/validate-hacs.yaml b/.github/workflows/validate-hacs.yaml new file mode 100644 index 0000000..836db0d --- /dev/null +++ b/.github/workflows/validate-hacs.yaml @@ -0,0 +1,21 @@ +name: Validate (HACS) + +on: + push: + pull_request: + schedule: + - cron: "0 0 * * *" + workflow_dispatch: + +permissions: {} + +jobs: + validate-hacs: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: HACS validation + uses: hacs/action@main + with: + category: integration diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8819daa --- /dev/null +++ b/LICENSE @@ -0,0 +1,26 @@ +MIT License + +Copyright (c) 2026 Petr Polezhaev + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- + +Вендоренный парсер JSON `third_party/jsmn` распространяется под лицензией +MIT (см. `third_party/jsmn/LICENSE`). diff --git a/MANIFEST.in b/MANIFEST.in index a01a29f..bdd64b9 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,4 @@ -include CMakeLists.txt README.md pyproject.toml setup.py +include CMakeLists.txt LICENSE README.md pyproject.toml setup.py recursive-include include *.h *.hpp recursive-include src *.cpp *.hpp recursive-include third_party * diff --git a/README.md b/README.md index 646f0fa..ddd2c99 100644 --- a/README.md +++ b/README.md @@ -126,5 +126,6 @@ converted from the module's 0.01 °C+5000 format. ## License / provenance -Protocol documentation and code reconstructed from the FGLair 3.4.3 APK for -interoperability; `third_party/jsmn` is MIT. +MIT — see [`LICENSE`](LICENSE). Protocol documentation and code reconstructed +from the FGLair 3.4.3 APK for interoperability; vendored `third_party/jsmn` +is MIT. diff --git a/custom_components/fglair/brand/dark_icon.png b/custom_components/fglair/brand/dark_icon.png new file mode 100644 index 0000000..cc10c50 Binary files /dev/null and b/custom_components/fglair/brand/dark_icon.png differ diff --git a/custom_components/fglair/brand/dark_icon@2x.png b/custom_components/fglair/brand/dark_icon@2x.png new file mode 100644 index 0000000..a446235 Binary files /dev/null and b/custom_components/fglair/brand/dark_icon@2x.png differ diff --git a/custom_components/fglair/brand/dark_logo.png b/custom_components/fglair/brand/dark_logo.png new file mode 100644 index 0000000..999233c Binary files /dev/null and b/custom_components/fglair/brand/dark_logo.png differ diff --git a/custom_components/fglair/brand/icon.png b/custom_components/fglair/brand/icon.png index 8c4598e..0aab11c 100644 Binary files a/custom_components/fglair/brand/icon.png and b/custom_components/fglair/brand/icon.png differ diff --git a/custom_components/fglair/brand/icon@2x.png b/custom_components/fglair/brand/icon@2x.png new file mode 100644 index 0000000..ad63b3b Binary files /dev/null and b/custom_components/fglair/brand/icon@2x.png differ diff --git a/custom_components/fglair/brand/logo.png b/custom_components/fglair/brand/logo.png index 541cd30..b2c434c 100644 Binary files a/custom_components/fglair/brand/logo.png and b/custom_components/fglair/brand/logo.png differ diff --git a/custom_components/fglair/manifest.json b/custom_components/fglair/manifest.json index 1557c39..f65a0b9 100644 --- a/custom_components/fglair/manifest.json +++ b/custom_components/fglair/manifest.json @@ -1,7 +1,7 @@ { "domain": "fglair", "name": "FGLair (Fujitsu General)", - "codeowners": [], + "codeowners": ["@petr.polezhaev"], "config_flow": true, "documentation": "https://git.ratigorsk-12.ru/esphome/fgl-aircon", "integration_type": "device", diff --git a/docs/RELEASE_HA.md b/docs/RELEASE_HA.md index 9aa089a..2c738ab 100644 --- a/docs/RELEASE_HA.md +++ b/docs/RELEASE_HA.md @@ -39,25 +39,44 @@ twine upload dist/manylinux/* dist/*.tar.gz repair` внутри, но текущий `bdist_wheel`-хук отдаёт тег `py3-none-`, поэтому проверяйте итоговые теги вручную. -## 2. GitHub-зеркало и HACS +## 2. GitHub-зеркало и Custom Repositories HACS устанавливает интеграции только с публичных **GitHub**-репозиториев -(GitLab/Gitea не поддерживаются). Шаги: +(GitLab/Gitea не поддерживаются: https://hacs.xyz/docs/faq/other_git_providers/). +Публикация в default-репозиторий HACS не требуется — достаточно Custom +Repositories, но хостинг обязан быть GitHub. -* создать GitHub-зеркало (push mirror) и убедиться, что оно содержит - `custom_components/fglair/`, `hacs.json`, тег релиза; -* заполнить `codeowners` в `custom_components/fglair/manifest.json` - (GitHub-хендлы; сейчас пустой список); +```sh +# один раз: зеркало и перенос веток/тегов +git remote add github git@github.com:/fgl-aircon.git +git push --mirror github +``` + +После зеркала: + +* заполнить в настройках GitHub: Description, Topics + (`home-assistant`, `hacs`, `fujitsu`, `air-conditioner`), включить Issues + (эти пункты проверяет HACS Action; файлами они не настраиваются); +* проверить `codeowners` в `custom_components/fglair/manifest.json` — + сейчас `@petr.polezhaev`; для GitHub Action/HACS это должен быть реальный + GitHub-логин; * проверить `documentation`/`issue_tracker` в манифесте; * обновить `version` манифеста под номер тега (сейчас `0.1.0`, pyfglair — - `1.0.0`; синхронизируйте по вкусу — компонент и пакет версионируются - отдельно); + `1.0.0`; компонент и пакет версионируются отдельно); * заменить заглушки `custom_components/fglair/screenshots/step-N.png` реальными скриншотами (описания «что должно быть видно» — в README); -* заменить заглушки `custom_components/fglair/brand/{icon,logo}.png` - фирменными ассетами; +* заменить заглушки `custom_components/fglair/brand/*.png` фирменными + ассетами (сейчас — сгенерированные плейсхолдеры: icon/icon@2x/logo и + тёмные варианты); * создать git-тег (semver) в GitHub-зеркале — HACS покажет версию. +Файлы, которые HACS/hassfest проверяют у интеграции: `hacs.json`, +`custom_components/fglair/manifest.json` (domain/documentation/ +issue_tracker/codeowners/name/version), `custom_components/fglair/brand/icon.png`, +README/info.md, OSI-лицензия (`LICENSE`, MIT). Всё это в репозитории есть; +workflow `.github/workflows/{validate-hacs,hassfest}.yaml` включатся на +GitHub. + ## 3. Приёмка на живом стенде * `tests/acceptance/test_esphome_ha.py quick` — матрица изменений (HA; diff --git a/info.md b/info.md new file mode 100644 index 0000000..8770475 --- /dev/null +++ b/info.md @@ -0,0 +1,36 @@ +# FGLair — локальное управление кондиционерами Fujitsu General + +Интеграция Home Assistant для кондиционеров Fujitsu General (FGLair / Ayla) +**по локальной сети, без облака в рантайме**. Протокол и ядро — C++ +(`fgl-aircon`), доступ из HA — через python-пакет `pyfglair` (cffi). + +## Возможности + +* `climate`: режим (off/cool/dry/fan/heat/auto), скорость вентилятора, + swing (вертикальный и горизонтальный), preset ECO/BOOST, уставка 16–30 °C, + текущая температура; +* `switch`: economy, powerful, coil dry, min heat, outdoor low noise, + human det auto save, Wi-Fi LED, indoor fan control; +* `select`: положение заслонок, `sensor`: температура/код ошибки/состояние + связи, `binary_sensor`: connectivity и флаги op_status; +* настройка через облако FGLair (однократно), вручную или импортом + `config_*.json`; превью шаблона с ручными конверсиями; +* Repair при несовпадении LAN-ключа, диагностика и переводы en/ru. + +## Установка + +HACS работает только с публичными **GitHub**-репозиториями — используйте +GitHub-зеркало этого репозитория: + +1. HACS → ⋮ → **Custom repositories** → URL GitHub-зеркала, категория + **Integration** → Add → Download → перезапуск HA. +2. Либо вручную скопируйте `custom_components/fglair/` в + `/custom_components/`. + +Требуется пакет `pyfglair` (манифест ставит его из PyPI) и HA ≥ 2025.1 на +Linux x86_64/aarch64. + +![Обзор устройства](custom_components/fglair/screenshots/step-7.png) + +Подробная инструкция — в +[`custom_components/fglair/README.md`](custom_components/fglair/README.md). diff --git a/pyproject.toml b/pyproject.toml index 723722b..bf4f9cd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=68", "wheel"] +requires = ["setuptools>=77", "wheel"] build-backend = "setuptools.build_meta" [project] @@ -7,6 +7,8 @@ name = "pyfglair" version = "1.0.0" description = "Local control of Fujitsu General (FGLair/Ayla) air conditioners: cffi bindings to the fgl-aircon C++ core" readme = "README.md" +license = "MIT" +license-files = ["LICENSE"] requires-python = ">=3.10" dependencies = [ "cffi>=1.15",