Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cfe316cca1 | ||
|
|
fcc6073298 | ||
|
|
489a868a4d | ||
|
|
7afe64d14c | ||
|
|
c366bc457a | ||
|
|
fa4d133d50 | ||
|
|
f129191a48 | ||
|
|
31237e76d9 | ||
|
|
fc59a786ed | ||
|
|
71cbd70f9e | ||
|
|
f12371e519 | ||
|
|
eae1c9cef2 | ||
|
|
8dff505bb4 | ||
|
|
342a98327d | ||
|
|
d10e83c750 | ||
|
|
0deb61f920 | ||
|
|
563095cbcf | ||
|
|
952feac482 | ||
|
|
7c229b37f2 | ||
|
|
19546a12e6 | ||
|
|
7b9b1030f2 | ||
|
|
13df970b21 | ||
|
|
8069a5d635 | ||
|
|
356b61e6e6 | ||
|
|
3b93a6a16b | ||
|
|
aa7eb0a9d9 | ||
|
|
0888c63b80 | ||
|
|
c6e7b332cf | ||
|
|
7b4fdfe629 | ||
|
|
15dd7e3880 | ||
|
|
28811370e9 | ||
|
|
a1fca2f4d1 | ||
|
|
d479bdb583 | ||
|
|
010a1144c5 | ||
|
|
6cf92d83f0 | ||
|
|
9f7199beab | ||
|
|
a02ae4106b | ||
|
|
6a411cea91 | ||
|
|
4ff72fdb07 | ||
|
|
93d1afd7e0 | ||
|
|
11bf31885e | ||
|
|
8b93ed6187 | ||
|
|
286f84fbb0 | ||
|
|
01a504f0ba | ||
|
|
c97fc433bc | ||
|
|
c5a78f998f | ||
|
|
eb106d7fe4 | ||
|
|
4ffa66c312 | ||
|
|
3ff545c6df | ||
|
|
458603e80c | ||
|
|
81dbc70b04 | ||
|
|
58ae700e0b | ||
|
|
399f55c57b | ||
|
|
900c40c8a1 | ||
|
|
860584ca79 | ||
|
|
d230ec6590 | ||
|
|
e0868fae9b | ||
|
|
59d3f9accd | ||
|
|
ee6dde688c | ||
|
|
e10e3e7c19 | ||
|
|
33756f1659 | ||
|
|
bd34c9fd81 | ||
|
|
590e110efa | ||
|
|
92b9392149 | ||
|
|
fced8328d7 | ||
|
|
ae301f25db | ||
|
|
fcc4de59c1 | ||
|
|
4587148d70 | ||
|
|
6c73814724 | ||
|
|
8c4009dc82 | ||
|
|
37de17749e | ||
|
|
d4c2548498 | ||
|
|
f889f18cd9 | ||
|
|
9abb91c3f9 | ||
|
|
76388df08c | ||
|
|
9626fafd2f | ||
|
|
71eb3a7c86 | ||
|
|
b9dd8bcad7 | ||
|
|
b1a5eca9a5 | ||
|
|
182a46cf92 | ||
|
|
e5c10104b8 |
@@ -0,0 +1,33 @@
|
|||||||
|
name: Test Runner
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- master
|
||||||
|
env:
|
||||||
|
GIT_SSL_NO_VERIFY: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
name: Test Job
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Echo message
|
||||||
|
run: |
|
||||||
|
echo "Hello from Gitea Actions!"
|
||||||
|
echo "Runner is working correctly!"
|
||||||
|
date
|
||||||
|
pwd
|
||||||
|
ls -la
|
||||||
|
|
||||||
|
- name: Test Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
|
||||||
|
- name: Check Python version
|
||||||
|
run: python --version
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
name: Update Version
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- master
|
||||||
|
- dev
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
update-version:
|
||||||
|
name: Update Version
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
# Пропускаем запуск, если коммит сделал сам бот (избегаем бесконечного цикла)
|
||||||
|
if: github.actor != 'gitea-actions[bot]' && github.actor != 'Gitea Actions Bot'
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
token: ${{ secrets.PAT_TOKEN }}
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: "3.11"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pip install python-semantic-release
|
||||||
|
|
||||||
|
- name: Configure Git
|
||||||
|
run: |
|
||||||
|
git config --local user.email "actions@gitea.local"
|
||||||
|
git config --local user.name "Gitea Actions Bot"
|
||||||
|
|
||||||
|
- name: Run semantic-release
|
||||||
|
env:
|
||||||
|
GITEA_TOKEN: ${{ secrets.PAT_TOKEN }}
|
||||||
|
run: |
|
||||||
|
unset GITHUB_SERVER_URL
|
||||||
|
unset GITHUB_API_URL
|
||||||
|
unset GITHUB_REPOSITORY
|
||||||
|
semantic-release version
|
||||||
@@ -0,0 +1,145 @@
|
|||||||
|
name: Test and Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
validate:
|
||||||
|
name: Validate Integration
|
||||||
|
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"
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
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"
|
||||||
|
|
||||||
|
release:
|
||||||
|
name: Create Release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [validate, test, lint]
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Get tag info
|
||||||
|
id: tag
|
||||||
|
run: |
|
||||||
|
TAG=${GITHUB_REF#refs/tags/}
|
||||||
|
echo "tag=$TAG" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
# Проверяем, это beta или stable релиз
|
||||||
|
if [[ "$TAG" == *"beta"* ]]; then
|
||||||
|
echo "is_beta=true" >> $GITHUB_OUTPUT
|
||||||
|
PRERELEASE_FLAG="--prerelease"
|
||||||
|
else
|
||||||
|
echo "is_beta=false" >> $GITHUB_OUTPUT
|
||||||
|
PRERELEASE_FLAG=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
- name: Create GitHub Release
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
TAG="${{ steps.tag.outputs.tag }}"
|
||||||
|
COMMITS="${{ steps.tag.outputs.commits }}"
|
||||||
|
IS_BETA="${{ steps.tag.outputs.is_beta }}"
|
||||||
|
|
||||||
|
echo "🚀 Создаём релиз $TAG в GitHub..."
|
||||||
|
|
||||||
|
if [ "$IS_BETA" = "true" ]; then
|
||||||
|
TITLE="Beta Release $TAG"
|
||||||
|
else
|
||||||
|
TITLE="Release $TAG"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat > /tmp/release_notes.md << EOF
|
||||||
|
## $TITLE
|
||||||
|
|
||||||
|
$COMMITS
|
||||||
|
EOF
|
||||||
|
|
||||||
|
gh release create "$TAG" \
|
||||||
|
--title "$TITLE" \
|
||||||
|
--notes-file /tmp/release_notes.md \
|
||||||
|
--target main \
|
||||||
|
${IS_BETA:+--prerelease}
|
||||||
|
|
||||||
|
echo "✅ Релиз создан!"
|
||||||
+155
@@ -0,0 +1,155 @@
|
|||||||
|
# CHANGELOG
|
||||||
|
|
||||||
|
<!-- version list -->
|
||||||
|
|
||||||
|
## v1.1.0 (2026-07-22)
|
||||||
|
|
||||||
|
|
||||||
|
## v1.1.0-beta.1 (2026-07-22)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
- Add dev branch for beta releases
|
||||||
|
([`fa4d133`](https://git.darkmode.duckdns.org/sirmrak/motion_light/commit/fa4d133d50e896428883919c98ef830780aacce2))
|
||||||
|
|
||||||
|
|
||||||
|
## v1.0.17 (2026-07-17)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- Test
|
||||||
|
([`31237e7`](https://git.darkmode.duckdns.org/sirmrak/motion_light/commit/31237e76d9c770dae4e04fad6d7a0196340a60c5))
|
||||||
|
|
||||||
|
|
||||||
|
## v1.0.16 (2026-07-10)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- Test new secrets
|
||||||
|
([`eae1c9c`](https://192.168.200.208:3000/sirmrak/motion_light/commit/eae1c9cef21aa9285a6e5b2174949b6bf2942154))
|
||||||
|
|
||||||
|
|
||||||
|
## v1.0.15 (2026-07-10)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- Lux_cooldown_active
|
||||||
|
([`342a983`](https://192.168.200.208:3000/sirmrak/motion_light/commit/342a98327d2297977323e12f84e0dc9bc8b3a49d))
|
||||||
|
|
||||||
|
|
||||||
|
## 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)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- Тестовый релиз
|
||||||
|
([`11bf318`](https://192.168.200.208:3000/sirmrak/motion_light/commit/11bf31885eb113d02cf5c1558446a4671c1dc202))
|
||||||
|
|
||||||
|
|
||||||
|
## v1.0.7 (2026-07-09)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- Тестим авторелиз
|
||||||
|
([`c5a78f9`](https://192.168.200.208:3000/sirmrak/motion_light/commit/c5a78f998fda972f0dfe4f938f0855d3c1d28aee))
|
||||||
|
|
||||||
|
|
||||||
|
## v1.0.6 (2026-07-09)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- Тестовое исправление для автоматического релиза
|
||||||
|
([`58ae700`](https://192.168.200.208:3000/sirmrak/motion_light/commit/58ae700e0ba31b664222eccd96aaa17d30d2eff4))
|
||||||
|
|
||||||
|
|
||||||
|
## v1.0.5 (2026-07-09)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- Configure semantic-release for Gitea with SSL
|
||||||
|
([`4587148`](https://192.168.200.208:3000/sirmrak/motion_light/commit/4587148d70e362fdd2a47523df0da959499fba2f))
|
||||||
|
|
||||||
|
- Disable SSL verification for semantic-release
|
||||||
|
([`ae301f2`](https://192.168.200.208:3000/sirmrak/motion_light/commit/ae301f25db468e56f9378582215b4dac6979722e))
|
||||||
|
|
||||||
|
- Release
|
||||||
|
([`59d3f9a`](https://192.168.200.208:3000/sirmrak/motion_light/commit/59d3f9accd5d2cb3b8e1ef4f403c7445e7da7b46))
|
||||||
|
|
||||||
|
- Release.yaml
|
||||||
|
([`bd34c9f`](https://192.168.200.208:3000/sirmrak/motion_light/commit/bd34c9fd81002974c08a6f349f0234b4e78353aa))
|
||||||
|
|
||||||
|
- Run Semantic Release
|
||||||
|
([`e10e3e7`](https://192.168.200.208:3000/sirmrak/motion_light/commit/e10e3e7c19c2da63289cd499cca5a5eacee22157))
|
||||||
|
|
||||||
|
- Test
|
||||||
|
([`e0868fa`](https://192.168.200.208:3000/sirmrak/motion_light/commit/e0868fae9ba86cd76eb070c5057960741eecba1e))
|
||||||
|
|
||||||
|
- Test commit for release
|
||||||
|
([`92b9392`](https://192.168.200.208:3000/sirmrak/motion_light/commit/92b93921498c7afd21d1dceec51518894c1efdcd))
|
||||||
|
|
||||||
|
- Изменил размер картинки
|
||||||
|
([`d4c2548`](https://192.168.200.208:3000/sirmrak/motion_light/commit/d4c25484981a33ab4455027ffb4ef693256aa414))
|
||||||
|
|
||||||
|
|
||||||
|
## v1.0.4 (2026-07-09)
|
||||||
|
|
||||||
|
|
||||||
|
## v1.0.3 (2026-07-08)
|
||||||
|
|
||||||
|
|
||||||
|
## v1.0.2 (2026-07-08)
|
||||||
|
|
||||||
|
|
||||||
|
## v1.0.1 (2026-07-08)
|
||||||
|
|
||||||
|
|
||||||
|
## v1.0.0 (2026-07-08)
|
||||||
|
|
||||||
|
- Initial Release
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2026 sirmrak
|
||||||
|
|
||||||
|
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.
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
[English](README.md) | Русский
|
[English](README.md) | Русский
|
||||||
# <img src="custom_components/motion_light/brand/icon.png" width="64"> </img> Motion Light
|
# <img src="custom_components/motion_light/brand/icon.png" width="32"> </img> Motion Light
|
||||||
|
|
||||||
Умная интеграция для Home Assistant на основе конечного автомата (FSM) для управления освещением по датчикам движения, освещенности и ручным переключениям.
|
Умная интеграция для Home Assistant на основе конечного автомата (FSM) для управления освещением по датчикам движения, освещенности и ручным переключениям.
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
"""The Motion Light integration."""
|
"""The Motion Light integration. Test"""
|
||||||
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
|
||||||
|
|||||||
@@ -604,12 +604,34 @@ class MotionLightCoordinator(DataUpdateCoordinator):
|
|||||||
self._check_lux_periodically,
|
self._check_lux_periodically,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
self.async_set_updated_data({
|
||||||
|
"state": self._state,
|
||||||
|
"attributes": self.attributes,
|
||||||
|
})
|
||||||
|
|
||||||
def _stop_lux_check_timer(self):
|
def _stop_lux_check_timer(self):
|
||||||
"""Stop periodic lux check timer."""
|
"""Stop periodic lux check timer."""
|
||||||
if self._lux_check_timer:
|
if self._lux_check_timer:
|
||||||
self.logger.debug("Stopping lux check timer")
|
self.logger.debug("Stopping lux check timer")
|
||||||
self._lux_check_timer()
|
self._lux_check_timer()
|
||||||
self._lux_check_timer = None
|
self._lux_check_timer = None
|
||||||
|
self.async_set_updated_data({
|
||||||
|
"state": self._state,
|
||||||
|
"attributes": self.attributes,
|
||||||
|
})
|
||||||
|
|
||||||
|
def _cancel_lux_cooldown(self):
|
||||||
|
"""Cancel lux cooldown when light is turned on."""
|
||||||
|
if self._lux_cooldown_active:
|
||||||
|
self.logger.debug("Cancelling lux cooldown")
|
||||||
|
self._lux_cooldown_active = False
|
||||||
|
if self._lux_cooldown_timer:
|
||||||
|
self._lux_cooldown_timer()
|
||||||
|
self._lux_cooldown_timer = None
|
||||||
|
self.async_set_updated_data({
|
||||||
|
"state": self._state,
|
||||||
|
"attributes": self.attributes,
|
||||||
|
})
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def _check_lux_periodically(self, _=None):
|
def _check_lux_periodically(self, _=None):
|
||||||
@@ -648,6 +670,7 @@ class MotionLightCoordinator(DataUpdateCoordinator):
|
|||||||
self.logger.debug("No sensors active, not turning on")
|
self.logger.debug("No sensors active, not turning on")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
self._cancel_lux_cooldown()
|
||||||
triggered_by = self._attributes.get("triggered_by")
|
triggered_by = self._attributes.get("triggered_by")
|
||||||
await self._turn_on_switches()
|
await self._turn_on_switches()
|
||||||
await self._update_state(STATE_ON, triggered_by=triggered_by)
|
await self._update_state(STATE_ON, triggered_by=triggered_by)
|
||||||
@@ -662,7 +685,7 @@ class MotionLightCoordinator(DataUpdateCoordinator):
|
|||||||
await self._update_state(STATE_IDLE)
|
await self._update_state(STATE_IDLE)
|
||||||
self._start_lux_check_timer()
|
self._start_lux_check_timer()
|
||||||
return
|
return
|
||||||
|
self._cancel_lux_cooldown()
|
||||||
triggered_by = self._attributes.get("triggered_by")
|
triggered_by = self._attributes.get("triggered_by")
|
||||||
await self._turn_on_switches()
|
await self._turn_on_switches()
|
||||||
await self._update_state(STATE_ON, triggered_by=triggered_by)
|
await self._update_state(STATE_ON, triggered_by=triggered_by)
|
||||||
@@ -727,6 +750,7 @@ class MotionLightCoordinator(DataUpdateCoordinator):
|
|||||||
|
|
||||||
async def _enter_manual_on(self):
|
async def _enter_manual_on(self):
|
||||||
"""Enter manual_on state."""
|
"""Enter manual_on state."""
|
||||||
|
self._cancel_lux_cooldown()
|
||||||
await self._update_state(STATE_MANUAL_ON)
|
await self._update_state(STATE_MANUAL_ON)
|
||||||
if self.manual_idle_timeout > 0:
|
if self.manual_idle_timeout > 0:
|
||||||
self._reset_manual_idle_timer()
|
self._reset_manual_idle_timer()
|
||||||
@@ -795,6 +819,10 @@ class MotionLightCoordinator(DataUpdateCoordinator):
|
|||||||
self._lux_cooldown_active = False
|
self._lux_cooldown_active = False
|
||||||
self._lux_cooldown_timer = None
|
self._lux_cooldown_timer = None
|
||||||
self.logger.info("Lux cooldown expired")
|
self.logger.info("Lux cooldown expired")
|
||||||
|
self.async_set_updated_data({
|
||||||
|
"state": self._state,
|
||||||
|
"attributes": self.attributes,
|
||||||
|
})
|
||||||
|
|
||||||
def _cancel_all_timers(self):
|
def _cancel_all_timers(self):
|
||||||
"""Cancel all timers."""
|
"""Cancel all timers."""
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"domain": "motion_light",
|
"domain": "motion_light",
|
||||||
"name": "Motion Light",
|
"name": "Motion Light",
|
||||||
"version": "1.0.2",
|
|
||||||
"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.1.0"
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
[tool.semantic_release]
|
||||||
|
tag_format = "v{version}"
|
||||||
|
|
||||||
|
version_variables = [
|
||||||
|
"custom_components/motion_light/manifest.json:version",
|
||||||
|
]
|
||||||
|
|
||||||
|
commit_message = "chore(release): v{version}"
|
||||||
|
|
||||||
|
# Отключаем создание релиза через API Gitea (релиз будет создаваться в GitHub)
|
||||||
|
upload_to_vcs_release = false
|
||||||
|
|
||||||
|
[tool.semantic_release.remote]
|
||||||
|
type = "gitea"
|
||||||
|
domain = "git.darkmode.duckdns.org"
|
||||||
|
api_domain = "git.darkmode.duckdns.org"
|
||||||
|
|
||||||
|
# Настройки для stable релизов (ветка main)
|
||||||
|
[tool.semantic_release.branches.main]
|
||||||
|
match = "(main|master)"
|
||||||
|
prerelease = false
|
||||||
|
|
||||||
|
# Настройки для beta релизов (ветка dev)
|
||||||
|
[tool.semantic_release.branches.dev]
|
||||||
|
match = "dev"
|
||||||
|
prerelease = true
|
||||||
|
prerelease_token = "beta"
|
||||||
|
|
||||||
|
[tool.semantic_release.commit_parser_options]
|
||||||
|
allowed_tags = ["feat", "fix", "docs", "style", "refactor", "perf", "test", "chore", "revert"]
|
||||||
|
minor_tags = ["feat"]
|
||||||
|
patch_tags = ["fix", "perf"]
|
||||||
Reference in New Issue
Block a user