Compare commits

..
24 Commits
Author SHA1 Message Date
semantic-release 0deb61f920 chore(release): v1.0.14
Update Version / Update Version (push) Successful in 5s
2026-07-09 19:22:51 +00:00
sirmrak 563095cbcf fix: Удалены переводы атрибутов из custom_components/motion_light/translations
Update Version / Update Version (push) Successful in 6s
2026-07-09 22:22:43 +03:00
sirmrak 952feac482 fixЖ перевод атрибутов удален
Update Version / Update Version (push) Successful in 5s
2026-07-09 22:20:23 +03:00
sirmrak 7c229b37f2 Обновить custom_components/motion_light/translations/ru.json
Update Version / Update Version (push) Successful in 5s
2026-07-09 22:11:42 +03:00
sirmrak 19546a12e6 Обновить custom_components/motion_light/translations/en.json
Update Version / Update Version (push) Successful in 5s
2026-07-09 22:09:15 +03:00
sirmrak 7b9b1030f2 Обновить custom_components/motion_light/translations/en.json
Update Version / Update Version (push) Successful in 5s
2026-07-09 22:08:45 +03:00
sirmrak 13df970b21 Обновить custom_components/motion_light/manifest.json
Update Version / Update Version (push) Successful in 5s
2026-07-09 22:05:41 +03:00
semantic-release 8069a5d635 chore(release): v1.0.13
Update Version / Update Version (push) Successful in 5s
2026-07-09 19:00:28 +00:00
sirmrak 356b61e6e6 fix: Test validation
Update Version / Update Version (push) Successful in 6s
2026-07-09 22:00:19 +03:00
sirmrak 3b93a6a16b Добавление тестов
Update Version / Update Version (push) Successful in 5s
2026-07-09 21:59:37 +03:00
semantic-release aa7eb0a9d9 chore(release): v1.0.12
Update Version / Update Version (push) Successful in 5s
2026-07-09 18:47:22 +00:00
sirmrak 0888c63b80 fix: test
Update Version / Update Version (push) Successful in 5s
2026-07-09 21:47:14 +03:00
sirmrak c6e7b332cf Обновить .gitea/workflows/update_version.yml
Update Version / Update Version (push) Successful in 5s
2026-07-09 21:45:52 +03:00
semantic-release 7b4fdfe629 chore(release): v1.0.11
Update Version / Update Version (push) Successful in 5s
2026-07-09 18:35:55 +00:00
sirmrak 15dd7e3880 fix: Test
Update Version / Update Version (push) Failing after 6s
2026-07-09 21:35:49 +03:00
sirmrak 28811370e9 Обновить .gitea/workflows/update_version.yml
Update Version / Update Version (push) Successful in 5s
2026-07-09 21:35:26 +03:00
sirmrak a1fca2f4d1 Обновить pyproject.toml
Update Version / Update Version (push) Successful in 6s
2026-07-09 21:34:44 +03:00
semantic-release d479bdb583 chore(release): v1.0.10
Update Version / Update Version (push) Successful in 6s
2026-07-09 18:26:23 +00:00
sirmrak 010a1144c5 fix: Test
Update Version / Update Version (push) Failing after 7s
2026-07-09 21:26:14 +03:00
sirmrak 6cf92d83f0 Обновить .gitea/workflows/update_version.yml
Update Version / Update Version (push) Successful in 5s
2026-07-09 21:24:56 +03:00
sirmrak 9f7199beab Обновить pyproject.toml
Update Version / Update Version (push) Successful in 5s
2026-07-09 21:23:53 +03:00
semantic-release a02ae4106b chore(release): v1.0.9
Update Version / Update Version (push) Successful in 4s
2026-07-09 18:08:02 +00:00
sirmrak 6a411cea91 fix: test
Update Version / Update Version (push) Failing after 7s
2026-07-09 21:07:53 +03:00
sirmrak 4ff72fdb07 Обновить pyproject.toml
Update Version / Update Version (push) Successful in 5s
2026-07-09 21:07:03 +03:00
8 changed files with 340 additions and 221 deletions
+25 -3
View File
@@ -13,6 +13,7 @@ jobs:
update-version: update-version:
name: Update Version name: Update Version
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.actor != 'gitea-actions[bot]' && github.actor != 'Gitea Actions Bot'
permissions: permissions:
contents: write contents: write
@@ -39,9 +40,30 @@ jobs:
- name: Run semantic-release - name: Run semantic-release
env: env:
GITEA_TOKEN: ${{ secrets.PAT_TOKEN }} GITEA_TOKEN: ${{ secrets.PAT_TOKEN }}
PYTHONHTTPSVERIFY: "0"
REQUESTS_CA_BUNDLE: ""
CURL_CA_BUNDLE: ""
run: | run: |
echo "🧹 Сбрасываем конфликтующие переменные Gitea Actions..."
unset GITHUB_SERVER_URL
unset GITHUB_API_URL
unset GITHUB_REPOSITORY
echo "🔐 Записываем оригинальный Root CA от mkcert из секретов..."
echo "${{ secrets.LOCAL_ROOT_CA }}" > /tmp/rootCA.crt
# Проверка на случай, если секрет забыли настроить
if [ ! -s /tmp/rootCA.crt ]; then
echo "❌ Ошибка: Секрет LOCAL_ROOT_CA пуст. Проверьте настройки репозитория!"
exit 1
fi
echo "✅ Root CA успешно прочитан."
# Находим, где конкретно Python (библиотека certifi) хранит свои сертификаты
CERTIFI_PATH=$(python3 -c "import certifi; print(certifi.where())")
echo "Путь к bundle Python: $CERTIFI_PATH"
# Внедряем корневой сертификат mkcert в конец доверенного списка Python
cat /tmp/rootCA.crt >> "$CERTIFI_PATH"
echo "✅ Root CA от mkcert добавлен в доверенные для Python!"
echo "🚀 Запускаем semantic-release..." echo "🚀 Запускаем semantic-release..."
semantic-release version semantic-release version
+94 -8
View File
@@ -1,14 +1,87 @@
name: Create Release name: Test and Release
on: on:
push: push:
tags: tags:
- 'v*' - 'v*'
workflow_dispatch: # Позволяет запускать вручную
jobs: jobs:
release: # Шаг 1: Валидация структуры HA интеграции
name: Create GitHub Release validate:
name: Validate Integration
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Hassfest Validation
uses: home-assistant/actions/hassfest@master
- name: HACS Validation
uses: hacs/action@main
with:
category: "integration"
# Шаг 2: Запуск тестов (если есть)
test:
name: Run Tests
runs-on: ubuntu-latest
needs: validate
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pytest-homeassistant-custom-component
if [ -f requirements_test.txt ]; then pip install -r requirements_test.txt; fi
- name: Run tests
run: |
if [ -d "tests" ]; then
pytest tests/ --cov=custom_components/motion_light --cov-report=xml
else
echo "No tests directory found, skipping tests"
fi
# Шаг 3: Проверка стиля кода
lint:
name: Code Quality
runs-on: ubuntu-latest
needs: validate
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install linters
run: |
pip install black ruff mypy
- name: Check code formatting with black
run: |
black --check custom_components/motion_light/ || echo "Code formatting issues found"
- name: Check code with ruff
run: |
ruff check custom_components/motion_light/ || echo "Ruff issues found"
# Шаг 4: Создание релиза (только если все проверки пройдены)
release:
name: Create Release
runs-on: ubuntu-latest
needs: [validate, test, lint]
permissions: permissions:
contents: write contents: write
@@ -24,9 +97,16 @@ jobs:
TAG=${GITHUB_REF#refs/tags/} TAG=${GITHUB_REF#refs/tags/}
echo "tag=$TAG" >> $GITHUB_OUTPUT echo "tag=$TAG" >> $GITHUB_OUTPUT
TAG_MSG=$(git tag -l --format='%(contents)' $TAG 2>/dev/null || git log -1 --pretty=%B) PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
echo "message<<EOF" >> $GITHUB_OUTPUT
echo "$TAG_MSG" >> $GITHUB_OUTPUT if [ -z "$PREV_TAG" ]; then
COMMITS=$(git log --pretty=format:"- %s" --reverse)
else
COMMITS=$(git log ${PREV_TAG}..HEAD --pretty=format:"- %s" --reverse)
fi
echo "commits<<EOF" >> $GITHUB_OUTPUT
echo "$COMMITS" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT
- name: Create GitHub Release - name: Create GitHub Release
@@ -34,13 +114,19 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: | run: |
TAG="${{ steps.tag.outputs.tag }}" TAG="${{ steps.tag.outputs.tag }}"
MSG="${{ steps.tag.outputs.message }}" COMMITS="${{ steps.tag.outputs.commits }}"
echo "🚀 Создаём релиз $TAG в GitHub..." echo "🚀 Создаём релиз $TAG в GitHub..."
cat > /tmp/release_notes.md << EOF
## Изменения в версии $TAG
$COMMITS
EOF
gh release create "$TAG" \ gh release create "$TAG" \
--title "Release $TAG" \ --title "Release $TAG" \
--notes "$MSG" \ --notes-file /tmp/release_notes.md \
--target main --target main
echo "✅ Релиз создан!" echo "✅ Релиз создан!"
+48
View File
@@ -2,6 +2,54 @@
<!-- version list --> <!-- version list -->
## v1.0.14 (2026-07-09)
### Bug Fixes
- Удалены переводы атрибутов из custom_components/motion_light/translations
([`563095c`](https://192.168.200.208:3000/sirmrak/motion_light/commit/563095cbcf77d22d02a7176faf5aec6837d18b37))
## v1.0.13 (2026-07-09)
### Bug Fixes
- Test validation
([`356b61e`](https://192.168.200.208:3000/sirmrak/motion_light/commit/356b61e6e618a423503d44d2f0d9ef96fee0da0d))
## v1.0.12 (2026-07-09)
### Bug Fixes
- Test
([`0888c63`](https://192.168.200.208:3000/sirmrak/motion_light/commit/0888c63b804be1e5bedd7e72fbfd142dd4f88287))
## v1.0.11 (2026-07-09)
### Bug Fixes
- Test
([`15dd7e3`](https://192.168.200.208:3000/sirmrak/motion_light/commit/15dd7e3880dad782f502eb70db6aa8ca23f803bc))
## v1.0.10 (2026-07-09)
### Bug Fixes
- Test
([`010a114`](https://192.168.200.208:3000/sirmrak/motion_light/commit/010a1144c5dc5252831126bfc9592036a7ca2518))
## v1.0.9 (2026-07-09)
### Bug Fixes
- Test
([`6a411ce`](https://192.168.200.208:3000/sirmrak/motion_light/commit/6a411cea91047e9714519dbb190d5d92252b024a))
## v1.0.8 (2026-07-09) ## v1.0.8 (2026-07-09)
### Bug Fixes ### Bug Fixes
+1 -1
View File
@@ -1,4 +1,4 @@
"""The Motion Light integration. Test""" """The Motion Light integration. Без превода атрибутов для локализации"""
import logging import logging
from homeassistant.config_entries import ConfigEntry from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant from homeassistant.core import HomeAssistant
+6 -6
View File
@@ -1,12 +1,12 @@
{ {
"domain": "motion_light", "domain": "motion_light",
"name": "Motion Light", "name": "Motion Light",
"version": "1.0.8",
"documentation": "https://github.com/sirmrak/motion_light",
"issue_tracker": "https://github.com/sirmrak/motion_light/issues",
"dependencies": [],
"codeowners": ["@sirmrak"], "codeowners": ["@sirmrak"],
"requirements": [], "config_flow": true,
"dependencies": [],
"documentation": "https://github.com/sirmrak/motion_light",
"iot_class": "local_push", "iot_class": "local_push",
"config_flow": true "issue_tracker": "https://github.com/sirmrak/motion_light/issues",
"requirements": [],
"version": "1.0.14"
} }
@@ -58,22 +58,6 @@
"force_stopped": "Force stopped", "force_stopped": "Force stopped",
"error": "Error", "error": "Error",
"disabled": "Disabled" "disabled": "Disabled"
},
"attributes": {
"switch_entities": "Controlled switches",
"main_sensors": "Main triggers",
"extend_sensors": "Extend sensors",
"lux_sensor": "Illuminance sensor",
"force_stop_sensor": "Force stop sensor",
"force_stop_state": "Force stop state",
"force_stop_active": "Force stop active",
"active_main_sensors": "Active main triggers",
"active_extend_sensors": "Active extend sensors",
"lux_value": "Current illuminance",
"lux_cooldown_active": "Lux cooldown active",
"lux_check_active": "Lux check active",
"triggered_by": "Triggered by",
"last_motion_time": "Last motion time"
} }
} }
}, },
@@ -58,22 +58,6 @@
"force_stopped": "Принудительная остановка", "force_stopped": "Принудительная остановка",
"error": "Ошибка", "error": "Ошибка",
"disabled": "Отключено" "disabled": "Отключено"
},
"attributes": {
"switch_entities": "Управляемые выключатели",
"main_sensors": "Главные триггеры",
"extend_sensors": "Датчики продления",
"lux_sensor": "Датчик освещённости",
"force_stop_sensor": "Датчик принудительной остановки",
"force_stop_state": "Состояние принудительной остановки",
"force_stop_active": "Принудительная остановка активна",
"active_main_sensors": "Активные главные триггеры",
"active_extend_sensors": "Активные датчики продления",
"lux_value": "Текущая освещённость",
"lux_cooldown_active": "Cooldown люкса активен",
"lux_check_active": "Проверка люкса активна",
"triggered_by": "Активировано",
"last_motion_time": "Последнее движение"
} }
} }
}, },
+5 -10
View File
@@ -1,29 +1,24 @@
[tool.semantic_release] [tool.semantic_release]
# Формат тега С префиксом v (для совместимости с существующими тегами)
tag_format = "v{version}" tag_format = "v{version}"
# Где обновлять версию при релизе
version_variables = [ version_variables = [
"custom_components/motion_light/manifest.json:version", "custom_components/motion_light/manifest.json:version",
] ]
# Сообщение коммита
commit_message = "chore(release): v{version}" commit_message = "chore(release): v{version}"
# Настройки для Gitea # ВАЖНО: не создаём релиз в Gitea (релиз будет в GitHub)
upload_to_vcs_release = false
[tool.semantic_release.remote] [tool.semantic_release.remote]
type = "gitea" type = "gitea"
# URL вашей Gitea (без trailing slash) domain = "192.168.200.208:3000"
domain = "https://192.168.200.208:3000" api_domain = "192.168.200.208:3000"
# Имя пользователя и репозитория
api_path = "/api/v1"
# Настройки веток
[tool.semantic_release.branches.main] [tool.semantic_release.branches.main]
match = "(main|master)" match = "(main|master)"
prerelease = false prerelease = false
# Настройки парсера коммитов
[tool.semantic_release.commit_parser_options] [tool.semantic_release.commit_parser_options]
allowed_tags = ["feat", "fix", "docs", "style", "refactor", "perf", "test", "chore", "revert"] allowed_tags = ["feat", "fix", "docs", "style", "refactor", "perf", "test", "chore", "revert"]
minor_tags = ["feat"] minor_tags = ["feat"]