Merge remote-tracking branch 'origin/main' into pr-sync-1031

This commit is contained in:
Bas Nijholt 2026-04-24 11:39:55 -07:00
commit 98acd36a71
No known key found for this signature in database
105 changed files with 12751 additions and 1373 deletions

View file

@ -873,6 +873,357 @@
"contributions": [
"translation"
]
},
{
"login": "MizterB",
"name": "MizterB",
"avatar_url": "https://avatars.githubusercontent.com/u/5458030?v=4",
"profile": "https://github.com/MizterB",
"contributions": [
"code"
]
},
{
"login": "brietman",
"name": "brietman",
"avatar_url": "https://avatars.githubusercontent.com/u/17436537?v=4",
"profile": "https://github.com/brietman",
"contributions": [
"translation"
]
},
{
"login": "TamilNeram",
"name": "தமிழ் நேரம்",
"avatar_url": "https://avatars.githubusercontent.com/u/67970539?v=4",
"profile": "https://github.com/TamilNeram",
"contributions": [
"translation"
]
},
{
"login": "Thunderstrike116",
"name": "Thunderstrike116",
"avatar_url": "https://avatars.githubusercontent.com/u/23220766?v=4",
"profile": "https://github.com/Thunderstrike116",
"contributions": [
"translation"
]
},
{
"login": "immeteor2",
"name": "immeteor2",
"avatar_url": "https://avatars.githubusercontent.com/u/125735487?v=4",
"profile": "https://github.com/immeteor2",
"contributions": [
"translation"
]
},
{
"login": "pbassut",
"name": "Patrick Bassut",
"avatar_url": "https://avatars.githubusercontent.com/u/1500037?v=4",
"profile": "https://github.com/pbassut",
"contributions": [
"translation"
]
},
{
"login": "Ricky-Tigg",
"name": "Ricky Tigg",
"avatar_url": "https://avatars.githubusercontent.com/u/26058215?v=4",
"profile": "https://github.com/Ricky-Tigg",
"contributions": [
"translation"
]
},
{
"login": "marazmarci",
"name": "Márton Maráz",
"avatar_url": "https://avatars.githubusercontent.com/u/1349654?v=4",
"profile": "https://github.com/marazmarci",
"contributions": [
"code"
]
},
{
"login": "Sara492",
"name": "Sara492",
"avatar_url": "https://avatars.githubusercontent.com/u/63058202?v=4",
"profile": "https://github.com/Sara492",
"contributions": [
"translation"
]
},
{
"login": "enpaga",
"name": "enpaga",
"avatar_url": "https://avatars.githubusercontent.com/u/180730931?v=4",
"profile": "https://github.com/enpaga",
"contributions": [
"translation"
]
},
{
"login": "xuars",
"name": "xuars",
"avatar_url": "https://avatars.githubusercontent.com/u/197080354?v=4",
"profile": "https://github.com/xuars",
"contributions": [
"translation"
]
},
{
"login": "tinutac",
"name": "tinutac",
"avatar_url": "https://avatars.githubusercontent.com/u/2151553?v=4",
"profile": "https://github.com/tinutac",
"contributions": [
"translation"
]
},
{
"login": "defaultpage",
"name": "Default User",
"avatar_url": "https://avatars.githubusercontent.com/u/22825202?v=4",
"profile": "https://github.com/defaultpage",
"contributions": [
"translation"
]
},
{
"login": "amelenty",
"name": "amelenty",
"avatar_url": "https://avatars.githubusercontent.com/u/29466876?v=4",
"profile": "https://github.com/amelenty",
"contributions": [
"translation"
]
},
{
"login": "yeaxi",
"name": "Rostyslav Dudka",
"avatar_url": "https://avatars.githubusercontent.com/u/15959384?v=4",
"profile": "https://ua.linkedin.com/in/rostyslav-dudka",
"contributions": [
"translation"
]
},
{
"login": "helderfmf",
"name": "Helder Ferreira",
"avatar_url": "https://avatars.githubusercontent.com/u/5622687?v=4",
"profile": "https://github.com/helderfmf",
"contributions": [
"translation"
]
},
{
"login": "mrpiotr-dev",
"name": "Piotr Laszczkowski",
"avatar_url": "https://avatars.githubusercontent.com/u/11849621?v=4",
"profile": "http://mrpiotr.dev",
"contributions": [
"translation"
]
},
{
"login": "rezaalmanda",
"name": "Reza",
"avatar_url": "https://avatars.githubusercontent.com/u/22217419?v=4",
"profile": "http://rezaalmanda.github.io",
"contributions": [
"translation"
]
},
{
"login": "bittin",
"name": "Luna Jernberg",
"avatar_url": "https://avatars.githubusercontent.com/u/43197?v=4",
"profile": "https://github.com/bittin",
"contributions": [
"translation"
]
},
{
"login": "jawilson",
"name": "Jeff Wilson",
"avatar_url": "https://avatars.githubusercontent.com/u/1368827?v=4",
"profile": "http://jeffalwilson.com",
"contributions": [
"code"
]
},
{
"login": "TermeHansen",
"name": "Rasmus Lundsgaard",
"avatar_url": "https://avatars.githubusercontent.com/u/6922018?v=4",
"profile": "https://github.com/TermeHansen",
"contributions": [
"code"
]
},
{
"login": "Tommatheussen",
"name": "Tom Matheussen",
"avatar_url": "https://avatars.githubusercontent.com/u/13683094?v=4",
"profile": "https://github.com/Tommatheussen",
"contributions": [
"code"
]
},
{
"login": "ams2990",
"name": "ams2990",
"avatar_url": "https://avatars.githubusercontent.com/u/488907?v=4",
"profile": "https://github.com/ams2990",
"contributions": [
"code"
]
},
{
"login": "DataGhost",
"name": "DataGhost",
"avatar_url": "https://avatars.githubusercontent.com/u/3911340?v=4",
"profile": "https://github.com/DataGhost",
"contributions": [
"code"
]
},
{
"login": "Wijt",
"name": "Furkan Kaya",
"avatar_url": "https://avatars.githubusercontent.com/u/23127261?v=4",
"profile": "https://iamfurkan.com",
"contributions": [
"translation"
]
},
{
"login": "Rafael4A",
"name": "Rafael do Amaral Porciuncula",
"avatar_url": "https://avatars.githubusercontent.com/u/32150173?v=4",
"profile": "https://github.com/Rafael4A",
"contributions": [
"translation"
]
},
{
"login": "hhjuhl",
"name": "hhjuhl",
"avatar_url": "https://avatars.githubusercontent.com/u/84127693?v=4",
"profile": "https://github.com/hhjuhl",
"contributions": [
"translation"
]
},
{
"login": "Athishbalu",
"name": "B.Athish",
"avatar_url": "https://avatars.githubusercontent.com/u/177029556?v=4",
"profile": "https://github.com/Athishbalu",
"contributions": [
"translation"
]
},
{
"login": "maksim2005UKR",
"name": "Горпиніч Максим Олександрович",
"avatar_url": "https://avatars.githubusercontent.com/u/233082001?v=4",
"profile": "https://github.com/maksim2005UKR",
"contributions": [
"translation"
]
},
{
"login": "plageoj",
"name": "Masayuki Sugahara",
"avatar_url": "https://avatars.githubusercontent.com/u/10688301?v=4",
"profile": "https://plageoj.me",
"contributions": [
"translation"
]
},
{
"login": "therealmate",
"name": "therealmate",
"avatar_url": "https://avatars.githubusercontent.com/u/61843503?v=4",
"profile": "https://github.com/therealmate",
"contributions": [
"translation"
]
},
{
"login": "dobby5",
"name": "Dobby",
"avatar_url": "https://avatars.githubusercontent.com/u/1346316?v=4",
"profile": "https://github.com/dobby5",
"contributions": [
"code"
]
},
{
"login": "lenucksi",
"name": "lenucksi",
"avatar_url": "https://avatars.githubusercontent.com/u/2451899?v=4",
"profile": "https://github.com/lenucksi",
"contributions": [
"code"
]
},
{
"login": "edgimar",
"name": "edgimar",
"avatar_url": "https://avatars.githubusercontent.com/u/393850?v=4",
"profile": "https://gitlab.com/edgimar",
"contributions": [
"code"
]
},
{
"login": "andrei-lazarov",
"name": "Andrei LAZAROV",
"avatar_url": "https://avatars.githubusercontent.com/u/51081857?v=4",
"profile": "https://github.com/andrei-lazarov",
"contributions": [
"doc"
]
},
{
"login": "ademuri",
"name": "Adam DeMuri",
"avatar_url": "https://avatars.githubusercontent.com/u/3051618?v=4",
"profile": "https://github.com/ademuri",
"contributions": [
"code"
]
},
{
"login": "NatanDosAnjos",
"name": "Natanael",
"avatar_url": "https://avatars.githubusercontent.com/u/45629905?v=4",
"profile": "https://github.com/NatanDosAnjos",
"contributions": [
"translation"
]
},
{
"login": "Yllelder",
"name": "Yllelder Bamir",
"avatar_url": "https://avatars.githubusercontent.com/u/6941502?v=4",
"profile": "https://github.com/Yllelder",
"contributions": [
"translation"
]
},
{
"login": "Esspel",
"name": "Esspel",
"avatar_url": "https://avatars.githubusercontent.com/u/47383506?v=4",
"profile": "https://github.com/Esspel",
"contributions": [
"translation"
]
}
],
"contributorsPerLine": 7,

View file

@ -1,7 +1,7 @@
{
"name": "basnijholt/adaptive_lighting",
"image": "mcr.microsoft.com/vscode/devcontainers/python:3.12",
"postCreateCommand": "scripts/setup-devcontainer",
"image": "mcr.microsoft.com/devcontainers/python:3-3.13",
"postCreateCommand": "./scripts/setup-devcontainer && . .venv/bin/activate",
"forwardPorts": [
8123
],
@ -36,7 +36,5 @@
}
},
"remoteUser": "vscode",
"features": {
"ghcr.io/devcontainers/features/rust:1": {}
}
"features": {}
}

View file

@ -18,7 +18,7 @@ If you need help with using or configuring Adaptive Lighting, please [open a Q&A
Please confirm that you have completed the following steps:
- [ ] I have updated to the [latest Adaptive Lighting version](https://github.com/basnijholt/adaptive-lighting/releases) available in [HACS](https://hacs.xyz/).
- [ ] I have reviewed the [Troubleshooting Section](https://github.com/basnijholt/adaptive-lighting#troubleshooting) in the [README](https://github.com/basnijholt/adaptive-lighting#readme).
- [ ] I have reviewed the [Troubleshooting Section](https://github.com/basnijholt/adaptive-lighting#sos-troubleshooting) in the [README](https://github.com/basnijholt/adaptive-lighting#readme).
- [ ] (If using Zigbee2MQTT) I have read the [Zigbee2MQTT troubleshooting guide](https://github.com/basnijholt/adaptive-lighting#zigbee2mqtt) in the [README](https://github.com/basnijholt/adaptive-lighting#readme).
- [ ] I have checked the [V2 Roadmap](https://github.com/basnijholt/adaptive-lighting/discussions/291) and [open issues](https://github.com/basnijholt/adaptive-lighting/issues) to ensure my issue isn't a duplicate.

38
.github/renovate.json vendored Normal file
View file

@ -0,0 +1,38 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"rebaseWhen": "behind-base-branch",
"dependencyDashboard": true,
"labels": [
"dependencies",
"no-stale"
],
"commitMessagePrefix": "⬆️",
"commitMessageTopic": "{{depName}}",
"prBodyDefinitions": {
"Release": "yes"
},
"packageRules": [
{
"matchManagers": [
"github-actions"
],
"addLabels": [
"github_actions"
],
"rangeStrategy": "pin"
},
{
"matchManagers": [
"github-actions"
],
"matchUpdateTypes": [
"minor",
"patch"
],
"automerge": true
}
],
"extends": [
"config:recommended"
]
}

View file

@ -22,7 +22,7 @@ data = {}
data_description = {}
for k, _, typ in const.VALIDATION_TUPLES:
desc = const.DOCS[k]
if len(desc) > 40 and typ != bool and typ != cv.entity_ids:
if len(desc) > 40 and typ not in (bool, cv.entity_ids):
data[k] = k
data_description[k] = desc
else:
@ -60,6 +60,9 @@ with en_fname.open() as f:
en["config"]["step"]["user"] = strings["config"]["step"]["user"]
en["options"]["step"]["init"]["data"] = data
en["options"]["step"]["init"]["data_description"] = data_description
en["options"]["step"]["init"]["description"] = strings["options"]["step"]["init"][
"description"
]
en["services"] = services_json
with en_fname.open("w") as f:

View file

@ -1,62 +0,0 @@
# Simple workflow for deploying WebAssembly app to GitHub Pages
name: Deploy WebAssembly app to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set Up Python
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Install Dependencies
run: |
pip install -r webapp/requirements-locked.txt
- name: Build the WebAssembly app
run: |
set -ex
cp custom_components/adaptive_lighting/color_and_brightness.py webapp/color_and_brightness.py
sed -i 's/homeassistant.util.color/homeassistant_util_color/g' "webapp/color_and_brightness.py"
shinylive export webapp site
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
# Upload the 'site' directory, where your app has been built
path: "site"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

View file

@ -1,32 +1,50 @@
name: docker
name: Docker
on:
push:
branches:
- "main"
branches: [main]
tags: ['v*']
pull_request:
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
docker:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
platform:
- linux/amd64
- linux/arm64
platform: [linux/amd64, linux/arm64]
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
- uses: actions/checkout@v6
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: meta
uses: docker/metadata-action@v5
with:
# Only push on the master branch
push: ${{ github.ref == 'refs/heads/master' }}
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable={{is_default_branch}}
- uses: docker/build-push-action@v6
with:
context: .
platforms: ${{ matrix.platform }}
tags: ${{ secrets.DOCKERHUB_USERNAME }}/adaptive-lighting:latest
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

64
.github/workflows/docs.yml vendored Normal file
View file

@ -0,0 +1,64 @@
name: Documentation
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.14.2'
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Install dependencies
run: uv sync --group docs
- name: Build documentation
run: uv run zensical build
- name: Build webapp (simulator)
run: uv run shinylive export webapp webapp-site
- name: Integrate webapp into docs
run: |
# Copy webapp into docs site at /simulator/
mkdir -p site/simulator
cp -r webapp-site/* site/simulator/
echo "Webapp integrated at site/simulator/"
- name: Upload artifact
uses: actions/upload-pages-artifact@v4
with:
path: ./site
deploy:
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

View file

@ -11,5 +11,5 @@ jobs:
validate_hassfest:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v3.0.2"
- uses: "actions/checkout@v6.0.2"
- uses: home-assistant/actions/hassfest@master

View file

@ -14,25 +14,28 @@ runs:
using: "composite"
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3
uses: actions/checkout@v6
with:
repository: ${{ github.repository }}
ref: ${{ github.ref }}
persist-credentials: false
fetch-depth: 0
- name: Check out code from GitHub
uses: actions/checkout@v3
uses: actions/checkout@v6
with:
repository: home-assistant/core
path: core
ref: ${{ inputs.core-version }}
- name: Set up Python ${{ inputs.python-version }}
id: python
uses: actions/setup-python@v4.1.0
uses: actions/setup-python@v6.1.0
with:
python-version: ${{ inputs.python-version }}
- name: Set up UV
uses: astral-sh/setup-uv@v7
- name: Install dependencies
shell: bash
run: |
uv venv --python ${{ inputs.python-version }}
./scripts/setup-dependencies
./scripts/setup-symlinks

View file

@ -11,7 +11,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v6
with:
ref: main
fetch-depth: 0

View file

@ -0,0 +1,48 @@
name: markdown-code-runner
on:
push:
branches:
- main
pull_request:
jobs:
markdown-code-runner:
runs-on: ubuntu-latest
steps:
- name: Check out code from GitHub
uses: actions/checkout@v6
with:
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
ref: ${{ github.head_ref || github.ref }}
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.14.2"
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Update generated content
run: ./scripts/update-generated-content
- name: Check for changes
run: |
if [ -n "$(git status --porcelain)" ]; then
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "::error::Auto-generated files are not up to date. Please run './scripts/update-generated-content' locally and push the changes."
exit 1
else
echo "Changes detected, committing and pushing..."
git add -u .
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -m "Update auto-generated content"
git pull --rebase
git push
fi
else
echo "No changes detected."
fi

View file

@ -9,6 +9,6 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/action@v3.0.0
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
- uses: pre-commit/action@v3.0.1

View file

@ -8,53 +8,51 @@ on:
jobs:
pytest:
name: Run pytest
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- python-version: "3.10"
core-version: "2022.11.5"
- python-version: "3.10"
core-version: "2022.12.9"
- python-version: "3.10"
core-version: "2023.1.7"
- python-version: "3.10"
core-version: "2023.2.5"
- python-version: "3.10"
core-version: "2023.3.6"
- python-version: "3.10"
core-version: "2023.4.6"
- python-version: "3.10"
core-version: "2023.5.4"
- python-version: "3.11"
core-version: "2023.6.3"
- python-version: "3.11"
core-version: "2023.7.3"
- python-version: "3.11"
core-version: "2023.8.4"
- python-version: "3.11"
core-version: "2023.9.3"
- python-version: "3.11"
core-version: "2023.10.5"
- python-version: "3.11"
core-version: "2023.11.3"
- python-version: "3.11"
core-version: "2023.12.4"
- python-version: "3.11"
core-version: "2024.1.6"
- python-version: "3.11"
core-version: "2024.2.5"
- python-version: "3.12"
core-version: "2024.3.3"
- python-version: "3.12"
core-version: "2024.4.1"
- python-version: "3.12"
core-version: "dev"
- core-version: "2024.12.5"
python-version: "3.12"
- core-version: "2025.1.4"
python-version: "3.12"
- core-version: "2025.2.5"
python-version: "3.13"
- core-version: "2025.3.4"
python-version: "3.13"
- core-version: "2025.4.4"
python-version: "3.13"
- core-version: "2025.5.3"
python-version: "3.13"
- core-version: "2025.6.3"
python-version: "3.13"
- core-version: "2025.7.4"
python-version: "3.13"
- core-version: "2025.8.3"
python-version: "3.13"
- core-version: "2025.9.4"
python-version: "3.13"
- core-version: "2025.10.4"
python-version: "3.13"
- core-version: "2025.11.3"
python-version: "3.13"
- core-version: "2025.12.5"
python-version: "3.13"
- core-version: "2026.1.3"
python-version: "3.13"
- core-version: "2026.2.3"
python-version: "3.13"
- core-version: "2026.3.4"
python-version: "3.14.2"
- core-version: "2026.4.3"
python-version: "3.14.2"
- core-version: "dev"
python-version: "3.14.2"
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3
uses: actions/checkout@v6
- name: Install Home Assistant
uses: ./.github/workflows/install_dependencies
@ -66,13 +64,14 @@ jobs:
timeout-minutes: 60
run: |
export PYTHONPATH=${PYTHONPATH}:${PWD}
source .venv/bin/activate
cd core
python3 -X dev -m pytest \
-vvv \
-qq \
--timeout=9 \
--durations=10 \
--cov="homeassistant" \
--cov=homeassistant.components.adaptive_lighting \
--cov-report=xml \
-o console_output_style=count \
-p no:sugar \

View file

@ -17,6 +17,6 @@ jobs:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
- uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View file

@ -1,4 +1,6 @@
on: push
on:
push:
branches: [main]
name: TOC Generator
jobs:
generateTOC:

View file

@ -1,57 +0,0 @@
name: Update README.md, strings.json, and services.yaml
on:
push:
branches:
- master
paths:
- "README.md"
- "custom_components/adaptive_lighting/const.py"
- "github/workflows/update-readme.yml"
pull_request:
jobs:
update_readme:
runs-on: ubuntu-latest
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3
- name: Install Home Assistant
uses: ./.github/workflows/install_dependencies
with:
python-version: "3.12"
- name: Install markdown-code-runner and README code dependencies
run: |
pip install markdown-code-runner==1.0.0 pandas tabulate
- name: Run markdown-code-runner
run: markdown-code-runner --debug README.md
- name: Run update services.yaml
run: python .github/update-services.py
- name: Run update strings.json
run: python .github/update-strings.py
- name: Commit updated README.md, strings.json, and services.yaml
id: commit
run: |
git add -u .
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
if git diff --quiet && git diff --staged --quiet; then
echo "No changes in README.md, strings.json, and services.yaml, skipping commit."
echo "commit_status=skipped" >> $GITHUB_ENV
else
git commit -m "Update README.md, strings.json, and services.yaml"
echo "commit_status=committed" >> $GITHUB_ENV
fi
- name: Push changes
if: env.commit_status == 'committed'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.head_ref }}

View file

@ -0,0 +1,59 @@
name: Update Test Matrix
on:
schedule:
# Run weekly on Monday at 9:00 UTC
- cron: "0 9 * * 1"
workflow_dispatch: # Allow manual trigger
permissions:
contents: write
pull-requests: write
jobs:
update-matrix:
name: Update HA Core versions in test matrix
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.14.2"
- name: Update test matrix
run: python scripts/update-test-matrix.py
- name: Check for changes
id: changes
run: |
if git diff --quiet .github/workflows/pytest.yaml; then
echo "changed=false" >> $GITHUB_OUTPUT
else
echo "changed=true" >> $GITHUB_OUTPUT
echo "Detected changes:"
git diff .github/workflows/pytest.yaml
fi
- name: Create Pull Request
if: steps.changes.outputs.changed == 'true'
uses: peter-evans/create-pull-request@v8
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "ci: update HA Core test matrix versions"
title: "ci: Update Home Assistant Core test matrix"
body: |
This PR automatically updates the pytest workflow to test against the latest Home Assistant Core versions.
## Changes
- Updated HA Core versions in the test matrix to include latest patch releases
---
🤖 Generated automatically by the update-test-matrix workflow
branch: update-test-matrix
delete-branch: true
labels: |
automation
ci

View file

@ -11,7 +11,7 @@ jobs:
validate_hacs:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v2"
- uses: "actions/checkout@v6"
- name: HACS validation
uses: "hacs/action@main"
with:

3
.gitignore vendored
View file

@ -135,3 +135,6 @@ dmypy.json
# Home Assistant configuration
config/*
!config/configuration.yaml
# Home Assistant core
core/

View file

@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: trailing-whitespace
@ -8,11 +8,11 @@ repos:
- id: mixed-line-ending
args: ["--fix=lf"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.5
rev: v0.11.13
hooks:
- id: ruff
args: ["--fix"]
- repo: https://github.com/psf/black
rev: 24.3.0
rev: 25.1.0
hooks:
- id: black

23
.vscode/settings.json vendored Normal file
View file

@ -0,0 +1,23 @@
{
"files.associations": {
"*.yaml": "home-assistant"
},
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
"python.testing.pytestEnabled": true,
"python.testing.pytestArgs": [
"-vvv",
"-qq",
"--timeout=9",
"--durations=10",
"--cov=homeassistant",
"--cov-report=xml",
"-o",
"console_output_style=count",
"-p",
"no:sugar",
"core/tests/components/adaptive_lighting"
],
"python.analysis.extraPaths": [
"${workspaceFolder}/core"
]
}

View file

@ -1,18 +1,20 @@
# See tests/README.md for instructions on how to run the tests.
# tl;dr:
# Run the following command in the adaptive-lighting repo folder to run the tests:
# docker run -v $(pwd):/app basnijholt/adaptive-lighting:latest
# 1. Clone HA core into ./core: git clone --depth 1 https://github.com/home-assistant/core.git core
# 2. Setup symlinks: ./scripts/setup-symlinks
# 3. Run tests (mount entire repo, not individual dirs, or symlinks break):
# docker run -v $(pwd):/app basnijholt/adaptive-lighting:latest
# Optionally build the image yourself with:
# docker build -t basnijholt/adaptive-lighting:latest .
FROM python:3.12-bookworm
FROM ghcr.io/astral-sh/uv:debian
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
git \
build-essential libssl-dev libffi-dev python3-dev \
# Install build dependencies for Python extensions
RUN apt-get update && apt-get install -y --no-install-recommends \
python3-dev \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Clone home-assistant/core
@ -25,12 +27,15 @@ COPY . /app/
RUN ln -s /core /app/core && /app/scripts/setup-symlinks
# Install home-assistant/core dependencies
RUN mkdir -p /.venv
ENV UV_PROJECT_ENVIRONMENT=/.venv UV_PYTHON=3.14.2 PATH="/.venv/bin:$PATH"
RUN uv venv
RUN /app/scripts/setup-dependencies
WORKDIR /core
WORKDIR /app/core
# Make 'custom_components/adaptive_lighting' imports available to tests
ENV PYTHONPATH="${PYTHONPATH}:/app"
ENV PYTHONPATH="/app"
ENTRYPOINT ["python3", \
# Enable Python development mode
@ -43,8 +48,8 @@ ENTRYPOINT ["python3", \
"--timeout=9", \
# Print the 10 slowest tests
"--durations=10", \
# Measure code coverage for the 'homeassistant' package
"--cov='homeassistant'", \
# Measure code coverage for the 'homeassistant.components.adaptive_lighting' component
"--cov=homeassistant.components.adaptive_lighting", \
# Generate an XML report of the code coverage
"--cov-report=xml", \
# Generate an HTML report of the code coverage

240
README.md
View file

@ -1,7 +1,7 @@
[![hacs_badge](https://img.shields.io/badge/HACS-Default-orange.svg?style=for-the-badge)](https://github.com/hacs/integration)
![Version](https://img.shields.io/github/v/release/basnijholt/adaptive-lighting?style=for-the-badge)
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-95-orange.svg?style=flat-square)](#contributors-)
[![All Contributors](https://img.shields.io/badge/all_contributors-134-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->
# 🌞 Adaptive Lighting: Enhance Your Home's Atmosphere with Smart, Sun-Synchronized Lighting 🌙
@ -10,7 +10,9 @@
[Adaptive Lighting](https://github.com/basnijholt/adaptive-lighting) is a custom component for [Home Assistant](https://www.home-assistant.io/) that intelligently adjusts the brightness and color of your lights 💡 based on the sun's position, while still allowing for manual control.
Download and install directly through [HACS (Home Assistant Community Store)](https://hacs.xyz/)
Download and install directly through [HACS (Home Assistant Community Store)](https://hacs.xyz/):
[![Open your Home Assistant instance and open the Adaptive Lighting integration inside the Home Assistant Community Store.](https://my.home-assistant.io/badges/hacs_repository.svg)](https://my.home-assistant.io/redirect/hacs_repository/?owner=basnijholt&repository=adaptive-lighting&category=integration)
By automatically adapting the settings of your lights throughout the day, Adaptive Lighting helps maintain your natural circadian rhythm 😴, which can lead to improved sleep, mood, and overall well-being. Experience cooler color temperatures at noon, gradually transitioning to warmer colors at sunset and sunrise.
@ -22,6 +24,7 @@ https://github.com/basnijholt/adaptive-lighting/assets/6897215/68908f7d-fbf1-499
[[ToC](#books-table-of-contents)]
<!-- SECTION:features:START -->
## :bulb: Features
When initially turning on a light that is controlled by Adaptive Lighting, the `light.turn_on` service call is intercepted, and the light's brightness and color are automatically adjusted based on the sun's position.
@ -33,7 +36,9 @@ Adaptive Lighting provides four switches (using "living_room" as an example comp
- `switch.adaptive_lighting_sleep_mode_living_room`: Activate "sleep mode" 😴 and set custom sleep_brightness and sleep_color_temp.
- `switch.adaptive_lighting_adapt_brightness_living_room`: Enable or disable brightness adaptation 🔆 for supported lights.
- `switch.adaptive_lighting_adapt_color_living_room`: Enable or disable color adaptation 🌈 for supported lights.
<!-- SECTION:features:END -->
<!-- SECTION:manual-control:START -->
### :control_knobs: Regain Manual Control
Adaptive Lighting is designed to automatically detect when you or another source (e.g., automation) manually changes light settings 🕹️.
@ -44,6 +49,7 @@ Additionally, enabling `detect_non_ha_changes` allows Adaptive Lighting to detec
The `adaptive_lighting.manual_control` event is fired when a light is marked as "manually controlled," allowing for integration with automations 🤖.
> ⚠️ **_Caution: Some lights might falsely indicate an 'on' state, which could result in lights turning on unexpectedly. Disable `detect_non_ha_changes` if you encounter such issues._**
<!-- SECTION:manual-control:END -->
## :books: Table of Contents
@ -96,56 +102,58 @@ Transform your home's atmosphere with Adaptive Lighting 🏠, and experience the
All of the configuration options are listed below, along with their default values.
The YAML and frontend configuration methods support all of the options listed below.
<!-- START_CODE -->
<!-- from homeassistant.components.adaptive_lighting import _docs_helpers -->
<!-- print(_docs_helpers.generate_config_markdown_table()) -->
<!-- END_CODE -->
<!-- CODE:START -->
<!-- from adaptive_lighting._docs_helpers import generate_config_markdown_table -->
<!-- print(generate_config_markdown_table()) -->
<!-- CODE:END -->
<!-- START_OUTPUT -->
<!-- THIS CONTENT IS AUTOMATICALLY GENERATED -->
| Variable name | Description | Default | Type |
|:-------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------|:---------------------------------------|
| `lights` | List of light entity_ids to be controlled (may be empty). 🌟 | `[]` | list of `entity_id`s |
| `interval` | Frequency to adapt the lights, in seconds. 🔄 | `90` | `int > 0` |
| `transition` | Duration of transition when lights change, in seconds. 🕑 | `45` | `float` 0-6553 |
| `initial_transition` | Duration of the first transition when lights turn from `off` to `on` in seconds. ⏲️ | `1` | `float` 0-6553 |
| `min_brightness` | Minimum brightness percentage. 💡 | `1` | `int` 1-100 |
| `max_brightness` | Maximum brightness percentage. 💡 | `100` | `int` 1-100 |
| `min_color_temp` | Warmest color temperature in Kelvin. 🔥 | `2000` | `int` 1000-10000 |
| `max_color_temp` | Coldest color temperature in Kelvin. ❄️ | `5500` | `int` 1000-10000 |
| `prefer_rgb_color` | Whether to prefer RGB color adjustment over light color temperature when possible. 🌈 | `False` | `bool` |
| `sleep_brightness` | Brightness percentage of lights in sleep mode. 😴 | `1` | `int` 1-100 |
| `sleep_rgb_or_color_temp` | Use either `"rgb_color"` or `"color_temp"` in sleep mode. 🌙 | `color_temp` | one of `['color_temp', 'rgb_color']` |
| `sleep_color_temp` | Color temperature in sleep mode (used when `sleep_rgb_or_color_temp` is `color_temp`) in Kelvin. 😴 | `1000` | `int` 1000-10000 |
| `sleep_rgb_color` | RGB color in sleep mode (used when `sleep_rgb_or_color_temp` is "rgb_color"). 🌈 | `[255, 56, 0]` | RGB color |
| `sleep_transition` | Duration of transition when "sleep mode" is toggled in seconds. 😴 | `1` | `float` 0-6553 |
| `transition_until_sleep` | When enabled, Adaptive Lighting will treat sleep settings as the minimum, transitioning to these values after sunset. 🌙 | `False` | `bool` |
| `sunrise_time` | Set a fixed time (HH:MM:SS) for sunrise. 🌅 | `None` | `str` |
| `min_sunrise_time` | Set the earliest virtual sunrise time (HH:MM:SS), allowing for later sunrises. 🌅 | `None` | `str` |
| `max_sunrise_time` | Set the latest virtual sunrise time (HH:MM:SS), allowing for earlier sunrises. 🌅 | `None` | `str` |
| `sunrise_offset` | Adjust sunrise time with a positive or negative offset in seconds. ⏰ | `0` | `int` |
| `sunset_time` | Set a fixed time (HH:MM:SS) for sunset. 🌇 | `None` | `str` |
| `min_sunset_time` | Set the earliest virtual sunset time (HH:MM:SS), allowing for later sunsets. 🌇 | `None` | `str` |
| `max_sunset_time` | Set the latest virtual sunset time (HH:MM:SS), allowing for earlier sunsets. 🌇 | `None` | `str` |
| `sunset_offset` | Adjust sunset time with a positive or negative offset in seconds. ⏰ | `0` | `int` |
| `brightness_mode` | Brightness mode to use. Possible values are `default`, `linear`, and `tanh` (uses `brightness_mode_time_dark` and `brightness_mode_time_light`). 📈 | `default` | one of `['default', 'linear', 'tanh']` |
| `brightness_mode_time_dark` | (Ignored if `brightness_mode='default'`) The duration in seconds to ramp up/down the brightness before/after sunrise/sunset. 📈📉 | `900` | `int` |
| `brightness_mode_time_light` | (Ignored if `brightness_mode='default'`) The duration in seconds to ramp up/down the brightness after/before sunrise/sunset. 📈📉. | `3600` | `int` |
| `take_over_control` | Disable Adaptive Lighting if another source calls `light.turn_on` while lights are on and being adapted. Note that this calls `homeassistant.update_entity` every `interval`! 🔒 | `True` | `bool` |
| `detect_non_ha_changes` | Detects and halts adaptations for non-`light.turn_on` state changes. Needs `take_over_control` enabled. 🕵️ Caution: ⚠️ Some lights might falsely indicate an 'on' state, which could result in lights turning on unexpectedly. Disable this feature if you encounter such issues. | `False` | `bool` |
| `autoreset_control_seconds` | Automatically reset the manual control after a number of seconds. Set to 0 to disable. ⏲️ | `0` | `int` 0-31536000 |
| `only_once` | Adapt lights only when they are turned on (`true`) or keep adapting them (`false`). 🔄 | `False` | `bool` |
| `adapt_only_on_bare_turn_on` | When turning lights on initially. If set to `true`, AL adapts only if `light.turn_on` is invoked without specifying color or brightness. ❌🌈 This e.g., prevents adaptation when activating a scene. If `false`, AL adapts regardless of the presence of color or brightness in the initial `service_data`. Needs `take_over_control` enabled. 🕵️ | `False` | `bool` |
| `separate_turn_on_commands` | Use separate `light.turn_on` calls for color and brightness, needed for some light types. 🔀 | `False` | `bool` |
| `send_split_delay` | Delay (ms) between `separate_turn_on_commands` for lights that don't support simultaneous brightness and color setting. ⏲️ | `0` | `int` 0-10000 |
| `adapt_delay` | Wait time (seconds) between light turn on and Adaptive Lighting applying changes. Might help to avoid flickering. ⏲️ | `0` | `float > 0` |
| `skip_redundant_commands` | Skip sending adaptation commands whose target state already equals the light's known state. Minimizes network traffic and improves the adaptation responsivity in some situations. 📉Disable if physical light states get out of sync with HA's recorded state. | `False` | `bool` |
| `intercept` | Intercept and adapt `light.turn_on` calls to enabling instantaneous color and brightness adaptation. 🏎️ Disable for lights that do not support `light.turn_on` with color and brightness. | `True` | `bool` |
| `multi_light_intercept` | Intercept and adapt `light.turn_on` calls that target multiple lights. ➗⚠️ This might result in splitting up a single `light.turn_on` call into multiple calls, e.g., when lights are in different switches. Requires `intercept` to be enabled. | `True` | `bool` |
| `include_config_in_attributes` | Show all options as attributes on the switch in Home Assistant when set to `true`. 📝 | `False` | `bool` |
<!-- OUTPUT:START -->
<!-- ⚠️ This content is auto-generated by `markdown-code-runner`. -->
| Variable name | Description | Default | Type |
|:-------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------|:----------------------------------------|
| `lights` | List of light entity_ids to be controlled (may be empty). 🌟 | `[]` | list of `entity_id`s |
| `interval` | Frequency to adapt the lights, in seconds. 🔄 | `90` | `int > 0` |
| `transition` | Duration of transition when lights change, in seconds. 🕑 | `45` | `float` 0-6553 |
| `initial_transition` | Duration of the first transition when lights turn from `off` to `on` in seconds. ⏲️ | `1` | `float` 0-6553 |
| `min_brightness` | Minimum brightness percentage. 💡 | `1` | `int` 1-100 |
| `max_brightness` | Maximum brightness percentage. 💡 | `100` | `int` 1-100 |
| `min_color_temp` | Warmest color temperature in Kelvin. 🔥 | `2000` | `int` 1000-10000 |
| `max_color_temp` | Coldest color temperature in Kelvin. ❄️ | `5500` | `int` 1000-10000 |
| `prefer_rgb_color` | Whether to prefer RGB color adjustment over light color temperature when possible. 🌈 | `False` | `bool` |
| `sleep_brightness` | Brightness percentage of lights in sleep mode. 😴 | `1` | `int` 1-100 |
| `sleep_rgb_or_color_temp` | Use either `"rgb_color"` or `"color_temp"` in sleep mode. 🌙 | `color_temp` | one of `['color_temp', 'rgb_color']` |
| `sleep_color_temp` | Color temperature in sleep mode (used when `sleep_rgb_or_color_temp` is `color_temp`) in Kelvin. 😴 | `1000` | `int` 1000-10000 |
| `sleep_rgb_color` | RGB color in sleep mode (used when `sleep_rgb_or_color_temp` is "rgb_color"). 🌈 | `[255, 56, 0]` | RGB color |
| `sleep_transition` | Duration of transition when "sleep mode" is toggled in seconds. 😴 | `1` | `float` 0-6553 |
| `transition_until_sleep` | When enabled, Adaptive Lighting will treat sleep settings as the minimum, transitioning to these values after sunset. 🌙 | `False` | `bool` |
| `sunrise_time` | Set a fixed time (HH:MM:SS) for sunrise. 🌅 | `None` | `str` |
| `min_sunrise_time` | Set the earliest virtual sunrise time (HH:MM:SS), allowing for later sunrises. 🌅 | `None` | `str` |
| `max_sunrise_time` | Set the latest virtual sunrise time (HH:MM:SS), allowing for earlier sunrises. 🌅 | `None` | `str` |
| `sunrise_offset` | Adjust sunrise time with a positive or negative offset in seconds. ⏰ | `0` | `int` |
| `sunset_time` | Set a fixed time (HH:MM:SS) for sunset. 🌇 | `None` | `str` |
| `min_sunset_time` | Set the earliest virtual sunset time (HH:MM:SS), allowing for later sunsets. 🌇 | `None` | `str` |
| `max_sunset_time` | Set the latest virtual sunset time (HH:MM:SS), allowing for earlier sunsets. 🌇 | `None` | `str` |
| `sunset_offset` | Adjust sunset time with a positive or negative offset in seconds. ⏰ | `0` | `int` |
| `brightness_mode` | Brightness mode to use. Possible values are `default`, `linear`, and `tanh` (uses `brightness_mode_time_dark` and `brightness_mode_time_light`). 📈 | `default` | one of `['default', 'linear', 'tanh']` |
| `brightness_mode_time_dark` | (Ignored if `brightness_mode='default'`) The duration in seconds to ramp up/down the brightness before/after sunrise/sunset. 📈📉 | `900` | `int` |
| `brightness_mode_time_light` | (Ignored if `brightness_mode='default'`) The duration in seconds to ramp up/down the brightness after/before sunrise/sunset. 📈📉. | `3600` | `int` |
| `take_over_control` | Pause adaptation of individual lights and hand over (manual) control to other sources that issue `light.turn_on` calls for lights that are on. 🔒 | `True` | `bool` |
| `take_over_control_mode` | The adaptation pausing mode when other sources change brightness and/or color of lights. `pause_all` always pauses both brightness and color adaptation. `pause_changed` pauses the adaptation of only the changed attributes and continues adapting unchanged attributes, e.g., continues color adaptation when only brightness was changed. | `pause_all` | one of `['pause_all', 'pause_changed']` |
| `detect_non_ha_changes` | Detects and halts adaptations for non-`light.turn_on` state changes. Needs `take_over_control` enabled. 🕵️ Caution: ⚠️ Some lights might falsely indicate an 'on' state, which could result in lights turning on unexpectedly. Note that this calls `homeassistant.update_entity` every `interval`! Disable this feature if you encounter such issues. | `False` | `bool` |
| `autoreset_control_seconds` | Automatically reset the manual control after a number of seconds. Set to 0 to disable. ⏲️ | `0` | `int` 0-31536000 |
| `only_once` | Adapt lights only when they are turned on (`true`) or keep adapting them (`false`). 🔄 | `False` | `bool` |
| `adapt_only_on_bare_turn_on` | When turning lights on initially. If set to `true`, AL adapts only if `light.turn_on` is invoked without specifying color or brightness. ❌🌈 This e.g., prevents adaptation when activating a scene and marks the light as manually controlled. If `false`, AL adapts regardless of the presence of color or brightness in the initial `service_data`. Needs `take_over_control` enabled. 🕵️ | `False` | `bool` |
| `separate_turn_on_commands` | Use separate `light.turn_on` calls for color and brightness, needed for some light types. 🔀 | `False` | `bool` |
| `send_split_delay` | Delay (ms) between `separate_turn_on_commands` for lights that don't support simultaneous brightness and color setting. ⏲️ | `0` | `int` 0-10000 |
| `adapt_delay` | Wait time (seconds) between light turn on and Adaptive Lighting applying changes. Might help to avoid flickering. ⏲️ | `0` | `float > 0` |
| `skip_redundant_commands` | Skip sending adaptation commands whose target state already equals the light's known state. Minimizes network traffic and improves the adaptation responsivity in some situations. 📉Disable if physical light states get out of sync with HA's recorded state. | `False` | `bool` |
| `intercept` | Intercept and adapt `light.turn_on` calls to enabling instantaneous color and brightness adaptation. 🏎️ Disable for lights that do not support `light.turn_on` with color and brightness. | `True` | `bool` |
| `multi_light_intercept` | Intercept and adapt `light.turn_on` calls that target multiple lights. ➗⚠️ This might result in splitting up a single `light.turn_on` call into multiple calls, e.g., when lights are in different switches. Requires `intercept` to be enabled. | `True` | `bool` |
| `include_config_in_attributes` | Show all options as attributes on the switch in Home Assistant when set to `true`. 📝 | `False` | `bool` |
<!-- END_OUTPUT -->
<!-- OUTPUT:END -->
<!-- SECTION:config-example-full:START -->
Full example:
```yaml
@ -172,6 +180,7 @@ adaptive_lighting:
only_once: false
```
<!-- SECTION:config-example-full:END -->
### :hammer_and_wrench: Services
@ -179,47 +188,50 @@ adaptive_lighting:
`adaptive_lighting.apply` applies Adaptive Lighting settings to lights on demand.
<!-- START_CODE -->
<!-- from homeassistant.components.adaptive_lighting import _docs_helpers -->
<!-- print(_docs_helpers.generate_apply_markdown_table()) -->
<!-- END_CODE -->
<!-- CODE:START -->
<!-- from adaptive_lighting._docs_helpers import generate_apply_markdown_table -->
<!-- print(generate_apply_markdown_table()) -->
<!-- CODE:END -->
<!-- START_OUTPUT -->
<!-- THIS CONTENT IS AUTOMATICALLY GENERATED -->
| Service data attribute | Description | Required | Type |
|:-------------------------|:-------------------------------------------------------------------------------------|:-----------|:---------------------|
| `entity_id` | The `entity_id` of the switch with the settings to apply. 📝 | ✅ | list of `entity_id`s |
| `lights` | A light (or list of lights) to apply the settings to. 💡 | ❌ | list of `entity_id`s |
| `transition` | Duration of transition when lights change, in seconds. 🕑 | ❌ | `float` 0-6553 |
| `adapt_brightness` | Whether to adapt the brightness of the light. 🌞 | ❌ | bool |
| `adapt_color` | Whether to adapt the color on supporting lights. 🌈 | ❌ | bool |
| `prefer_rgb_color` | Whether to prefer RGB color adjustment over light color temperature when possible. 🌈 | ❌ | bool |
| `turn_on_lights` | Whether to turn on lights that are currently off. 🔆 | ❌ | bool |
<!-- OUTPUT:START -->
<!-- ⚠️ This content is auto-generated by `markdown-code-runner`. -->
| Service data attribute | Description | Required | Type |
|:-------------------------|:--------------------------------------------------------------------------------------|:-----------|:---------------------|
| `entity_id` | The `entity_id` of the switch with the settings to apply. 📝 | ✅ | list of `entity_id`s |
| `lights` | A light (or list of lights) to apply the settings to. 💡 | ❌ | list of `entity_id`s |
| `transition` | Duration of transition when lights change, in seconds. 🕑 | ❌ | `float` 0-6553 |
| `adapt_brightness` | Whether to adapt the brightness of the light. 🌞 | ❌ | bool |
| `adapt_color` | Whether to adapt the color on supporting lights. 🌈 | ❌ | bool |
| `prefer_rgb_color` | Whether to prefer RGB color adjustment over light color temperature when possible. 🌈 | ❌ | bool |
| `turn_on_lights` | Whether to turn on lights that are currently off. 🔆 | ❌ | bool |
<!-- END_OUTPUT -->
<!-- OUTPUT:END -->
#### `adaptive_lighting.set_manual_control`
`adaptive_lighting.set_manual_control` can mark (or unmark) whether a light is "manually controlled", meaning that when a light has `manual_control`, the light is not adapted.
<!-- START_CODE -->
<!-- from homeassistant.components.adaptive_lighting import _docs_helpers -->
<!-- print(_docs_helpers.generate_set_manual_control_markdown_table()) -->
<!-- END_CODE -->
<!-- CODE:START -->
<!-- from adaptive_lighting._docs_helpers import generate_set_manual_control_markdown_table -->
<!-- print(generate_set_manual_control_markdown_table()) -->
<!-- CODE:END -->
<!-- START_OUTPUT -->
<!-- THIS CONTENT IS AUTOMATICALLY GENERATED -->
| Service data attribute | Description | Required | Type |
|:-------------------------|:-----------------------------------------------------------------------------------------------|:-----------|:---------------------|
| `entity_id` | The `entity_id` of the switch in which to (un)mark the light as being `manually controlled`. 📝 | ✅ | list of `entity_id`s |
| `lights` | entity_id(s) of lights, if not specified, all lights in the switch are selected. 💡 | ❌ | list of `entity_id`s |
| `manual_control` | Whether to add ("true") or remove ("false") the light from the "manual_control" list. 🔒 | ❌ | bool |
<!-- OUTPUT:START -->
<!-- ⚠️ This content is auto-generated by `markdown-code-runner`. -->
| Service data attribute | Description | Required | Type |
|:-------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------|:-----------------------------------------|
| `entity_id` | The `entity_id` of the switch in which to (un)mark the light as being `manually controlled`. 📝 | ✅ | list of `entity_id`s |
| `lights` | entity_id(s) of lights, if not specified, all lights in the switch are selected. 💡 | ❌ | list of `entity_id`s |
| `manual_control` | Whether to add ("true") or remove ("false") all adapted attributes of the light from the "manual_control" list, or the name of an attribute for selective addition. 🔒 | ❌ | bool or one of `['brightness', 'color']` |
<!-- END_OUTPUT -->
<!-- OUTPUT:END -->
<!-- SECTION:change-switch-settings:START -->
#### `adaptive_lighting.change_switch_settings`
`adaptive_lighting.change_switch_settings` (new in 1.7.0) Change any of the above configuration options of Adaptive Lighting (such as `sunrise_time` or `prefer_rgb_color`) with a service call directly from your script/automation.
> ⚠️ **_Note: These settings will **not** be written to your config and will be reset on restart of Home Assistant! You can see the current settings in the `switch.adaptive_lighting_XXX` attributes if `include_config_in_attributes` is enabled._**
> [!WARNING]
> These settings will **not** be written to your config and will be reset on restart of Home Assistant! You can see the current settings in the `switch.adaptive_lighting_XXX` attributes if `include_config_in_attributes` is enabled.
| Service data attribute | Required | Description |
| --------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
@ -234,10 +246,12 @@ The following keys are disallowed:
| `lights` | You may call `adaptive_lighting.apply` with your lights or create a new config instead. |
| `name` | You can rename your switch's display name in Home Assistant's UI. |
| `interval` | The interval is used only once when the config loads. A config change and restart are required. |
<!-- SECTION:change-switch-settings:END -->
<!-- SECTION:automation-examples:START -->
## :robot: Automation examples
<details>
<details markdown="1">
<summary>Reset the <code>manual_control</code> status of a light after an hour.</summary>
```yaml
@ -262,7 +276,7 @@ The following keys are disallowed:
</details>
<details>
<details markdown="1">
<summary>Toggle multiple Adaptive Lighting switches to "sleep mode" using an <code>input_boolean.sleep_mode</code>.</summary>
```yaml
@ -333,6 +347,7 @@ iphone_carly_wakeup:
```
</details>
<!-- SECTION:automation-examples:END -->
## Additional Information
@ -342,6 +357,7 @@ Adaptive Lighting was initially inspired by @claytonjn's [hass-circadian\_lighti
## :sos: Troubleshooting
<!-- SECTION:troubleshooting-intro:START -->
Encountering issues? Enable debug logging in your `configuration.yaml`:
```yaml
@ -352,7 +368,9 @@ logger:
```
After the issue occurs, create a new issue report with the log (`/config/home-assistant.log`).
<!-- SECTION:troubleshooting-intro:END -->
<!-- SECTION:common-problems:START -->
### :exclamation: Common Problems & Solutions
#### :bulb: Lights Not Responding or Turning On by Themselves
@ -376,7 +394,7 @@ Ensure your light bulbs have a strong WiFi connection. If the signal strength is
#### :spider_web: Zigbee, Z-Wave, and Other Mesh Networks
Mesh networks typically require powered devices to act as routers, relaying messages back to the central coordinator (the radio connected to Home Assistant).
Philips lights usually function as routers, while Ikea, Sengled, and generic Tuya bulbs often do not.
Most modern lights function as routers, very early models may not.
If devices become unresponsive or fail to respond to commands, Adaptive Lighting can exacerbate the issue.
Use network maps (available in ZHA, zigbee2mqtt, deCONZ, and ZWaveJS UI) to evaluate your network health.
Smart plugs can be an affordable way to add more routers to your network.
@ -410,7 +428,9 @@ These lights are known to exhibit disadvantageous behaviour due to firmware bugs
- Ikea Tradfri bulbs/drivers (and related Ikea smart light products)
- Unsupported simultaneous transition of brightness and color: When receiving such a command, they switch the brightness instantly and only transition the color. To get smooth transitions of both brightness and color, enable `separate_turn_on_commands`.
- Unresponsiveness during color transitions: No other commands are processed during an ongoing color transition, e.g., turn-off commands are ignored and lights stay on despite being reported as off to Home Assistant. The default config with long transitions thus results in long periods of unresponsiveness. To work around this, disable transitions by setting `transition` to `0`, and increase the adaptation frequency by setting `interval` to a short time, e.g., `15` seconds, to retain the impression of smooth continuous adaptations. Keeping the `initial_transition` is recommended for a smooth fade-in (lights are usually not turned off momentarily after being turned on, in which case a short period of unresponsiveness is tolerable).
<!-- SECTION:common-problems:END -->
<!-- SECTION:graphs:START -->
## :bar_chart: Graphs!
These graphs were generated using the values calculated by the Adaptive Lighting sensor/switch(es).
@ -425,10 +445,12 @@ These graphs were generated using the values calculated by the Adaptive Lighting
### While using `transition_until_sleep: true`
![image](https://user-images.githubusercontent.com/2219836/228949675-f9699624-8abc-466c-bb04-250ce0f495b8.png)
<!-- SECTION:graphs:END -->
<!-- SECTION:brightness-modes:START -->
### Custom brightness ramps using `brightness_mode` with `"linear"` and `"tanh"`
<details>
<details markdown="1">
<summary>Enhance your control over brightness transitions during sunrise and sunset with <code>brightness_mode</code> (click here to learn more 🧠).</summary>
With Adaptive Lighting, you can set a `brightness_mode` to specify how the brightness changes during sunrise and sunset. The `brightness_mode` can be set to `"default"` ([as illustrated in other graphs above](#high_brightness-brightness)), `"linear"`, or `"tanh"`. If you choose to deviate from the `"default"` mode, you can adjust `brightness_mode_time_dark` and `brightness_mode_time_light` to further customize the lighting transitions.
@ -451,12 +473,15 @@ Notice the values of `brightness_mode_time_light` and `brightness_mode_time_dark
![image](https://github.com/basnijholt/adaptive-lighting/assets/6897215/3dcbdc42-63c4-49df-8651-d2fae53dd08d)
> Check out the interactive webapp on https://basnijholt.github.io/adaptive-lighting/ to play with the parameters and see how the brightness changes!
<!-- SECTION:brightness-modes:END -->
<!-- SECTION:see-also:START -->
## :eyes: See also
- [*Sleep better with Adaptive Lighting in Home Assistant*](https://wartner.io/sleep-better-with-adaptive-lightning-in-home-assistant/) by Florian Wartner on 2023-02-23 (blog post 📜)
- [*Automatic smart light brightness and color based on the sun*](https://www.youtube.com/watch?v=Rg3zI1Oyk3c) by Home Automation Guy on 2022-08-31 (YouTube video 📺)
- [*Adaptive Lighting Blew My Mind in Home Assistant - How to set it up*](https://www.youtube.com/watch?v=c1cnccmgl3k) by Smart Home Junkie on 2022-06-26 (YouTube video 📺)
<!-- SECTION:see-also:END -->
## :busts_in_silhouette: Contributors
@ -587,6 +612,57 @@ Notice the values of `brightness_mode_time_light` and `brightness_mode_time_dark
<td align="center" valign="top" width="14.28%"><a href="https://blog.ebbinghaus.me/"><img src="https://avatars.githubusercontent.com/u/2965273?v=4?s=100" width="100px;" alt="Björn Ebbinghaus"/><br /><sub><b>Björn Ebbinghaus</b></sub></a><br /><a href="https://github.com/basnijholt/adaptive-lighting/commits?author=MrEbbinghaus" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Marck"><img src="https://avatars.githubusercontent.com/u/18088281?v=4?s=100" width="100px;" alt="Marck"/><br /><sub><b>Marck</b></sub></a><br /><a href="https://github.com/basnijholt/adaptive-lighting/commits?author=Marck" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://carmodsheaven.com"><img src="https://avatars.githubusercontent.com/u/11273726?v=4?s=100" width="100px;" alt="Lucho Gizdov"/><br /><sub><b>Lucho Gizdov</b></sub></a><br /><a href="#translation-lachezar-gizdov" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/MizterB"><img src="https://avatars.githubusercontent.com/u/5458030?v=4?s=100" width="100px;" alt="MizterB"/><br /><sub><b>MizterB</b></sub></a><br /><a href="https://github.com/basnijholt/adaptive-lighting/commits?author=MizterB" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/brietman"><img src="https://avatars.githubusercontent.com/u/17436537?v=4?s=100" width="100px;" alt="brietman"/><br /><sub><b>brietman</b></sub></a><br /><a href="#translation-brietman" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/TamilNeram"><img src="https://avatars.githubusercontent.com/u/67970539?v=4?s=100" width="100px;" alt="தமிழ் நேரம்"/><br /><sub><b>தமிழ் நேரம்</b></sub></a><br /><a href="#translation-TamilNeram" title="Translation">🌍</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Thunderstrike116"><img src="https://avatars.githubusercontent.com/u/23220766?v=4?s=100" width="100px;" alt="Thunderstrike116"/><br /><sub><b>Thunderstrike116</b></sub></a><br /><a href="#translation-Thunderstrike116" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/immeteor2"><img src="https://avatars.githubusercontent.com/u/125735487?v=4?s=100" width="100px;" alt="immeteor2"/><br /><sub><b>immeteor2</b></sub></a><br /><a href="#translation-immeteor2" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/pbassut"><img src="https://avatars.githubusercontent.com/u/1500037?v=4?s=100" width="100px;" alt="Patrick Bassut"/><br /><sub><b>Patrick Bassut</b></sub></a><br /><a href="#translation-pbassut" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Ricky-Tigg"><img src="https://avatars.githubusercontent.com/u/26058215?v=4?s=100" width="100px;" alt="Ricky Tigg"/><br /><sub><b>Ricky Tigg</b></sub></a><br /><a href="#translation-Ricky-Tigg" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/marazmarci"><img src="https://avatars.githubusercontent.com/u/1349654?v=4?s=100" width="100px;" alt="Márton Maráz"/><br /><sub><b>Márton Maráz</b></sub></a><br /><a href="https://github.com/basnijholt/adaptive-lighting/commits?author=marazmarci" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Sara492"><img src="https://avatars.githubusercontent.com/u/63058202?v=4?s=100" width="100px;" alt="Sara492"/><br /><sub><b>Sara492</b></sub></a><br /><a href="#translation-Sara492" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/enpaga"><img src="https://avatars.githubusercontent.com/u/180730931?v=4?s=100" width="100px;" alt="enpaga"/><br /><sub><b>enpaga</b></sub></a><br /><a href="#translation-enpaga" title="Translation">🌍</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/xuars"><img src="https://avatars.githubusercontent.com/u/197080354?v=4?s=100" width="100px;" alt="xuars"/><br /><sub><b>xuars</b></sub></a><br /><a href="#translation-xuars" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/tinutac"><img src="https://avatars.githubusercontent.com/u/2151553?v=4?s=100" width="100px;" alt="tinutac"/><br /><sub><b>tinutac</b></sub></a><br /><a href="#translation-tinutac" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/defaultpage"><img src="https://avatars.githubusercontent.com/u/22825202?v=4?s=100" width="100px;" alt="Default User"/><br /><sub><b>Default User</b></sub></a><br /><a href="#translation-defaultpage" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/amelenty"><img src="https://avatars.githubusercontent.com/u/29466876?v=4?s=100" width="100px;" alt="amelenty"/><br /><sub><b>amelenty</b></sub></a><br /><a href="#translation-amelenty" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://ua.linkedin.com/in/rostyslav-dudka"><img src="https://avatars.githubusercontent.com/u/15959384?v=4?s=100" width="100px;" alt="Rostyslav Dudka"/><br /><sub><b>Rostyslav Dudka</b></sub></a><br /><a href="#translation-yeaxi" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/helderfmf"><img src="https://avatars.githubusercontent.com/u/5622687?v=4?s=100" width="100px;" alt="Helder Ferreira"/><br /><sub><b>Helder Ferreira</b></sub></a><br /><a href="#translation-helderfmf" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://mrpiotr.dev"><img src="https://avatars.githubusercontent.com/u/11849621?v=4?s=100" width="100px;" alt="Piotr Laszczkowski"/><br /><sub><b>Piotr Laszczkowski</b></sub></a><br /><a href="#translation-mrpiotr-dev" title="Translation">🌍</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="http://rezaalmanda.github.io"><img src="https://avatars.githubusercontent.com/u/22217419?v=4?s=100" width="100px;" alt="Reza"/><br /><sub><b>Reza</b></sub></a><br /><a href="#translation-rezaalmanda" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/bittin"><img src="https://avatars.githubusercontent.com/u/43197?v=4?s=100" width="100px;" alt="Luna Jernberg"/><br /><sub><b>Luna Jernberg</b></sub></a><br /><a href="#translation-bittin" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://jeffalwilson.com"><img src="https://avatars.githubusercontent.com/u/1368827?v=4?s=100" width="100px;" alt="Jeff Wilson"/><br /><sub><b>Jeff Wilson</b></sub></a><br /><a href="https://github.com/basnijholt/adaptive-lighting/commits?author=jawilson" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/TermeHansen"><img src="https://avatars.githubusercontent.com/u/6922018?v=4?s=100" width="100px;" alt="Rasmus Lundsgaard"/><br /><sub><b>Rasmus Lundsgaard</b></sub></a><br /><a href="https://github.com/basnijholt/adaptive-lighting/commits?author=TermeHansen" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Tommatheussen"><img src="https://avatars.githubusercontent.com/u/13683094?v=4?s=100" width="100px;" alt="Tom Matheussen"/><br /><sub><b>Tom Matheussen</b></sub></a><br /><a href="https://github.com/basnijholt/adaptive-lighting/commits?author=Tommatheussen" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/ams2990"><img src="https://avatars.githubusercontent.com/u/488907?v=4?s=100" width="100px;" alt="ams2990"/><br /><sub><b>ams2990</b></sub></a><br /><a href="https://github.com/basnijholt/adaptive-lighting/commits?author=ams2990" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/DataGhost"><img src="https://avatars.githubusercontent.com/u/3911340?v=4?s=100" width="100px;" alt="DataGhost"/><br /><sub><b>DataGhost</b></sub></a><br /><a href="https://github.com/basnijholt/adaptive-lighting/commits?author=DataGhost" title="Code">💻</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://iamfurkan.com"><img src="https://avatars.githubusercontent.com/u/23127261?v=4?s=100" width="100px;" alt="Furkan Kaya"/><br /><sub><b>Furkan Kaya</b></sub></a><br /><a href="#translation-Wijt" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Rafael4A"><img src="https://avatars.githubusercontent.com/u/32150173?v=4?s=100" width="100px;" alt="Rafael do Amaral Porciuncula"/><br /><sub><b>Rafael do Amaral Porciuncula</b></sub></a><br /><a href="#translation-Rafael4A" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/hhjuhl"><img src="https://avatars.githubusercontent.com/u/84127693?v=4?s=100" width="100px;" alt="hhjuhl"/><br /><sub><b>hhjuhl</b></sub></a><br /><a href="#translation-hhjuhl" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Athishbalu"><img src="https://avatars.githubusercontent.com/u/177029556?v=4?s=100" width="100px;" alt="B.Athish"/><br /><sub><b>B.Athish</b></sub></a><br /><a href="#translation-Athishbalu" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/maksim2005UKR"><img src="https://avatars.githubusercontent.com/u/233082001?v=4?s=100" width="100px;" alt="Горпиніч Максим Олександрович"/><br /><sub><b>Горпиніч Максим Олександрович</b></sub></a><br /><a href="#translation-maksim2005UKR" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://plageoj.me"><img src="https://avatars.githubusercontent.com/u/10688301?v=4?s=100" width="100px;" alt="Masayuki Sugahara"/><br /><sub><b>Masayuki Sugahara</b></sub></a><br /><a href="#translation-plageoj" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/therealmate"><img src="https://avatars.githubusercontent.com/u/61843503?v=4?s=100" width="100px;" alt="therealmate"/><br /><sub><b>therealmate</b></sub></a><br /><a href="#translation-therealmate" title="Translation">🌍</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/dobby5"><img src="https://avatars.githubusercontent.com/u/1346316?v=4?s=100" width="100px;" alt="Dobby"/><br /><sub><b>Dobby</b></sub></a><br /><a href="https://github.com/basnijholt/adaptive-lighting/commits?author=dobby5" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/lenucksi"><img src="https://avatars.githubusercontent.com/u/2451899?v=4?s=100" width="100px;" alt="lenucksi"/><br /><sub><b>lenucksi</b></sub></a><br /><a href="https://github.com/basnijholt/adaptive-lighting/commits?author=lenucksi" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://gitlab.com/edgimar"><img src="https://avatars.githubusercontent.com/u/393850?v=4?s=100" width="100px;" alt="edgimar"/><br /><sub><b>edgimar</b></sub></a><br /><a href="https://github.com/basnijholt/adaptive-lighting/commits?author=edgimar" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/andrei-lazarov"><img src="https://avatars.githubusercontent.com/u/51081857?v=4?s=100" width="100px;" alt="Andrei LAZAROV"/><br /><sub><b>Andrei LAZAROV</b></sub></a><br /><a href="https://github.com/basnijholt/adaptive-lighting/commits?author=andrei-lazarov" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/ademuri"><img src="https://avatars.githubusercontent.com/u/3051618?v=4?s=100" width="100px;" alt="Adam DeMuri"/><br /><sub><b>Adam DeMuri</b></sub></a><br /><a href="https://github.com/basnijholt/adaptive-lighting/commits?author=ademuri" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/NatanDosAnjos"><img src="https://avatars.githubusercontent.com/u/45629905?v=4?s=100" width="100px;" alt="Natanael"/><br /><sub><b>Natanael</b></sub></a><br /><a href="#translation-NatanDosAnjos" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Yllelder"><img src="https://avatars.githubusercontent.com/u/6941502?v=4?s=100" width="100px;" alt="Yllelder Bamir"/><br /><sub><b>Yllelder Bamir</b></sub></a><br /><a href="#translation-Yllelder" title="Translation">🌍</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Esspel"><img src="https://avatars.githubusercontent.com/u/47383506?v=4?s=100" width="100px;" alt="Esspel"/><br /><sub><b>Esspel</b></sub></a><br /><a href="#translation-Esspel" title="Translation">🌍</a></td>
</tr>
</tbody>
<tfoot>

View file

@ -7,10 +7,10 @@ import homeassistant.helpers.config_validation as cv
import voluptuous as vol
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
from homeassistant.const import CONF_SOURCE
from homeassistant.core import HomeAssistant
from homeassistant.core import Event, HomeAssistant
from .const import (
_DOMAIN_SCHEMA,
_DOMAIN_SCHEMA, # pyright: ignore[reportPrivateUsage]
ATTR_ADAPTIVE_LIGHTING_MANAGER,
CONF_NAME,
DOMAIN,
@ -22,7 +22,7 @@ _LOGGER = logging.getLogger(__name__)
PLATFORMS = ["switch"]
def _all_unique_names(value):
def _all_unique_names(value: list[dict[str, Any]]) -> list[dict[str, Any]]:
"""Validate that all entities have a unique profile name."""
hosts = [device[CONF_NAME] for device in value]
schema = vol.Schema(vol.Unique())
@ -36,12 +36,16 @@ CONFIG_SCHEMA = vol.Schema(
)
async def reload_configuration_yaml(event: dict, hass: HomeAssistant): # noqa: ARG001
async def reload_configuration_yaml(event: Event) -> None:
"""Reload configuration.yaml."""
await hass.services.async_call("homeassistant", "check_config", {})
hass: HomeAssistant | None = event.data.get("hass")
if hass is not None:
await hass.services.async_call("homeassistant", "check_config", {})
else:
_LOGGER.error("HomeAssistant instance not found in event data.")
async def async_setup(hass: HomeAssistant, config: dict[str, Any]):
async def async_setup(hass: HomeAssistant, config: dict[str, Any]) -> bool:
"""Import integration from config."""
if DOMAIN in config:
for entry in config[DOMAIN]:
@ -55,7 +59,7 @@ async def async_setup(hass: HomeAssistant, config: dict[str, Any]):
return True
async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry):
async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool:
"""Set up the component."""
data = hass.data.setdefault(DOMAIN, {})
@ -65,20 +69,17 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry):
undo_listener = config_entry.add_update_listener(async_update_options)
data[config_entry.entry_id] = {UNDO_UPDATE_LISTENER: undo_listener}
for platform in PLATFORMS:
hass.async_create_task(
hass.config_entries.async_forward_entry_setup(config_entry, platform),
)
await hass.config_entries.async_forward_entry_setups(config_entry, PLATFORMS)
return True
async def async_update_options(hass, config_entry: ConfigEntry):
async def async_update_options(hass: HomeAssistant, config_entry: ConfigEntry) -> None:
"""Update options."""
await hass.config_entries.async_reload(config_entry.entry_id)
async def async_unload_entry(hass, config_entry: ConfigEntry) -> bool:
async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool:
"""Unload a config entry."""
unload_ok = await hass.config_entries.async_forward_entry_unload(
config_entry,

View file

@ -15,7 +15,7 @@ from .const import (
)
def _format_voluptuous_instance(instance):
def _format_voluptuous_instance(instance: vol.All) -> str:
coerce_type = None
min_val = None
max_val = None
@ -46,6 +46,8 @@ def _type_to_str(type_: Any) -> str: # noqa: PLR0911
return "bool"
if isinstance(type_, vol.All):
return _format_voluptuous_instance(type_)
if isinstance(type_, vol.Any):
return " or ".join(_type_to_str(t) for t in type_.validators)
if isinstance(type_, vol.In):
return f"one of `{type_.container}`"
if isinstance(type_, selector.SelectSelector):
@ -56,10 +58,8 @@ def _type_to_str(type_: Any) -> str: # noqa: PLR0911
raise ValueError(msg)
def generate_config_markdown_table():
import pandas as pd
rows = []
def generate_config_markdown_table() -> str:
rows: list[dict[str, str]] = []
for k, default, type_ in VALIDATION_TUPLES:
description = DOCS[k]
row = {
@ -75,7 +75,7 @@ def generate_config_markdown_table():
def _schema_to_dict(schema: vol.Schema) -> dict[str, tuple[Any, Any]]:
result = {}
result: dict[str, tuple[Any, Any]] = {}
for key, value in schema.schema.items():
if isinstance(key, vol.Optional):
default_value = key.default
@ -84,12 +84,12 @@ def _schema_to_dict(schema: vol.Schema) -> dict[str, tuple[Any, Any]]:
def _generate_service_markdown_table(
schema: dict[str, tuple[Any, Any]],
schema: dict[str, tuple[Any, Any]] | vol.Schema,
alternative_docs: dict[str, str] | None = None,
):
schema = _schema_to_dict(schema)
rows = []
for k, (default, type_) in schema.items():
) -> str:
schema_dict = _schema_to_dict(schema) if isinstance(schema, vol.Schema) else schema
rows: list[dict[str, str]] = []
for k, (default, type_) in schema_dict.items():
if alternative_docs is not None and k in alternative_docs:
description = alternative_docs[k]
else:
@ -106,11 +106,11 @@ def _generate_service_markdown_table(
return df.to_markdown(index=False)
def generate_apply_markdown_table():
def generate_apply_markdown_table() -> str:
return _generate_service_markdown_table(apply_service_schema(), DOCS_APPLY)
def generate_set_manual_control_markdown_table():
def generate_set_manual_control_markdown_table() -> str:
return _generate_service_markdown_table(
SET_MANUAL_CONTROL_SCHEMA,
DOCS_MANUAL_CONTROL,

View file

@ -3,7 +3,8 @@
import logging
from collections.abc import AsyncGenerator
from dataclasses import dataclass
from typing import Any, Literal
from enum import IntFlag, auto
from typing import Any
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
@ -12,6 +13,8 @@ from homeassistant.components.light import (
ATTR_BRIGHTNESS_STEP_PCT,
ATTR_COLOR_NAME,
ATTR_COLOR_TEMP_KELVIN,
ATTR_EFFECT,
ATTR_FLASH,
ATTR_HS_COLOR,
ATTR_RGB_COLOR,
ATTR_RGBW_COLOR,
@ -45,6 +48,41 @@ BRIGHTNESS_ATTRS = {
ServiceData = dict[str, Any]
class LightControlAttributes(IntFlag):
"""Attributes of lights that the adaptation engine can control."""
NONE = 0
BRIGHTNESS = auto()
COLOR = auto()
ALL = BRIGHTNESS | COLOR
def __str__(self) -> str:
"""Return a string representation of the attributes."""
if self == LightControlAttributes.NONE:
return "NONE"
return "|".join(
member.name
for member in type(self)
if member is not LightControlAttributes.NONE
and member in self
and member.name is not None
)
def has_any(self) -> bool:
"""Determine whether any attribute is selected."""
return self != LightControlAttributes.NONE
def has_none(self) -> bool:
"""Determine whether no attribute is selected."""
return self == LightControlAttributes.NONE
def has_all(self) -> bool:
"""Determine whether all attributes are selected."""
return (self & LightControlAttributes.ALL) == LightControlAttributes.ALL
def _split_service_call_data(service_data: ServiceData) -> list[ServiceData]:
"""Splits the service data by the adapted attributes.
@ -54,7 +92,7 @@ def _split_service_call_data(service_data: ServiceData) -> list[ServiceData]:
common_data = {k: service_data[k] for k in common_attrs if k in service_data}
attributes_split_sequence = [BRIGHTNESS_ATTRS, COLOR_ATTRS]
service_datas = []
service_datas: list[dict[str, Any]] = []
for attributes in attributes_split_sequence:
split_data = {
@ -69,8 +107,8 @@ def _split_service_call_data(service_data: ServiceData) -> list[ServiceData]:
if service_datas and (transition := service_data.get(ATTR_TRANSITION)) is not None:
transition /= len(service_datas)
for service_data in service_datas:
service_data[ATTR_TRANSITION] = transition
for _service_data in service_datas:
_service_data[ATTR_TRANSITION] = transition
return service_datas
@ -84,10 +122,11 @@ def _remove_redundant_attributes(
Removes all attributes from service call data whose values are already present
in the target entity's state.
"""
attributes: dict[str, Any] = dict(state.attributes)
return {
k: v
for k, v in service_data.items()
if k not in state.attributes or v != state.attributes[k]
if k not in attributes or v != attributes[k]
}
@ -106,7 +145,7 @@ async def _create_service_call_data_iterator(
hass: HomeAssistant,
service_datas: list[ServiceData],
filter_by_state: bool,
) -> AsyncGenerator[ServiceData, None]:
) -> AsyncGenerator[ServiceData]:
"""Enumerates and filters a list of service datas on the fly.
If filtering is enabled, every service data is filtered by the current state of
@ -141,10 +180,10 @@ class AdaptationData:
entity_id: str
context: Context
sleep_time: float
service_call_datas: AsyncGenerator[ServiceData, None]
service_call_datas: AsyncGenerator[ServiceData]
force: bool
max_length: int
which: Literal["brightness", "color", "both"]
attributes: LightControlAttributes
initial_sleep: bool = False
async def next_service_call_data(self) -> ServiceData | None:
@ -160,7 +199,7 @@ class AdaptationData:
f"sleep_time={self.sleep_time}, "
f"force={self.force}, "
f"max_length={self.max_length}, "
f"which={self.which}, "
f"attributes={self.attributes}, "
f"initial_sleep={self.initial_sleep}"
")"
)
@ -170,20 +209,25 @@ class NoColorOrBrightnessInServiceDataError(Exception):
"""Exception raised when no color or brightness attributes are found in service data."""
def _identify_lighting_type(
def _identify_light_control_attributes(
service_data: ServiceData,
) -> Literal["brightness", "color", "both"]:
) -> LightControlAttributes:
"""Extract the 'which' attribute from the service data."""
has_brightness = ATTR_BRIGHTNESS in service_data
has_color = any(attr in service_data for attr in COLOR_ATTRS)
if has_brightness and has_color:
return "both"
parameters = LightControlAttributes.NONE
if has_brightness:
return "brightness"
parameters |= LightControlAttributes.BRIGHTNESS
if has_color:
return "color"
msg = f"Invalid service_data, no brightness or color attributes found: {service_data=}"
raise NoColorOrBrightnessInServiceDataError(msg)
parameters |= LightControlAttributes.COLOR
if parameters == LightControlAttributes.NONE:
msg = f"Invalid service_data, no brightness or color attributes found: {service_data=}"
raise NoColorOrBrightnessInServiceDataError(msg)
return parameters
def prepare_adaptation_data(
@ -219,7 +263,7 @@ def prepare_adaptation_data(
filter_by_state,
)
lighting_type = _identify_lighting_type(service_data)
attributes = _identify_light_control_attributes(service_data)
return AdaptationData(
entity_id=entity_id,
@ -228,5 +272,58 @@ def prepare_adaptation_data(
service_call_datas=service_data_iterator,
force=force,
max_length=service_datas_length,
which=lighting_type,
attributes=attributes,
)
def manual_control_event_attribute_to_flags(
manual_control_attribute: bool | str,
) -> LightControlAttributes:
"""Convert manual control event data to light control attributes."""
if isinstance(manual_control_attribute, bool) and manual_control_attribute:
return LightControlAttributes.ALL
if manual_control_attribute == "brightness":
return LightControlAttributes.BRIGHTNESS
if manual_control_attribute == "color":
return LightControlAttributes.COLOR
return LightControlAttributes.NONE
def has_brightness_attribute(
service_data: ServiceData,
) -> bool:
"""Determine whether the service data contains brightness attributes."""
return any(attr in BRIGHTNESS_ATTRS for attr in service_data)
def has_color_attribute(
service_data: ServiceData,
) -> bool:
"""Determine whether the service data contains color attributes."""
return any(attr in COLOR_ATTRS for attr in service_data)
def has_effect_attribute(
service_data: ServiceData,
) -> bool:
"""Determine whether the service data contains effect attributes."""
return ATTR_FLASH in service_data or ATTR_EFFECT in service_data
def get_light_control_attributes(
service_data: ServiceData,
) -> LightControlAttributes:
"""Get the light control attributes affected by the service call data."""
parameters = LightControlAttributes.NONE
if has_brightness_attribute(service_data):
parameters |= LightControlAttributes.BRIGHTNESS
if has_color_attribute(service_data):
parameters |= LightControlAttributes.COLOR
if has_effect_attribute(service_data):
parameters |= LightControlAttributes.BRIGHTNESS
parameters |= LightControlAttributes.COLOR
return parameters

View file

@ -8,7 +8,8 @@ import datetime
import logging
import math
from dataclasses import dataclass
from datetime import timedelta
from datetime import UTC, timedelta
from enum import Enum
from functools import cached_property, partial
from typing import TYPE_CHECKING, Any, Literal, cast
@ -19,20 +20,23 @@ from homeassistant.util.color import (
)
if TYPE_CHECKING:
import astral
import astral.location
# Same as homeassistant.const.SUN_EVENT_SUNRISE and homeassistant.const.SUN_EVENT_SUNSET
# We re-define them here to not depend on homeassistant in this file.
SUN_EVENT_SUNRISE = "sunrise"
SUN_EVENT_SUNSET = "sunset"
SUN_EVENT_NOON = "solar_noon"
SUN_EVENT_MIDNIGHT = "solar_midnight"
class SunEvent(str, Enum):
"""A set of sun events that happen during a day."""
_ORDER = (SUN_EVENT_SUNRISE, SUN_EVENT_NOON, SUN_EVENT_SUNSET, SUN_EVENT_MIDNIGHT)
# Same as homeassistant.const.SUN_EVENT_SUNRISE and homeassistant.const.SUN_EVENT_SUNSET
# We re-define them here to not depend on homeassistant in this file.
SUNRISE = "sunrise"
SUNSET = "sunset"
NOON = "solar_noon"
MIDNIGHT = "solar_midnight"
_ORDER = (SunEvent.SUNRISE, SunEvent.NOON, SunEvent.SUNSET, SunEvent.MIDNIGHT)
_ALLOWED_ORDERS = {_ORDER[i:] + _ORDER[:i] for i in range(len(_ORDER))}
UTC = datetime.timezone.utc
utcnow: partial[datetime.datetime] = partial(datetime.datetime.now, UTC)
utcnow.__doc__ = "Get now in UTC time."
@ -44,7 +48,7 @@ class SunEvents:
"""Track the state of the sun and associated light settings."""
name: str
astral_location: astral.Location
astral_location: astral.location.Location
sunrise_time: datetime.time | None
min_sunrise_time: datetime.time | None
max_sunrise_time: datetime.time | None
@ -64,12 +68,10 @@ class SunEvents:
) + self.sunrise_offset
if self.min_sunrise_time is not None:
min_sunrise = self._replace_time(dt, self.min_sunrise_time)
if min_sunrise > sunrise:
sunrise = min_sunrise
sunrise = max(min_sunrise, sunrise)
if self.max_sunrise_time is not None:
max_sunrise = self._replace_time(dt, self.max_sunrise_time)
if max_sunrise < sunrise:
sunrise = max_sunrise
sunrise = min(max_sunrise, sunrise)
return sunrise
def sunset(self, dt: datetime.date) -> datetime.datetime:
@ -81,12 +83,10 @@ class SunEvents:
) + self.sunset_offset
if self.min_sunset_time is not None:
min_sunset = self._replace_time(dt, self.min_sunset_time)
if min_sunset > sunset:
sunset = min_sunset
sunset = max(min_sunset, sunset)
if self.max_sunset_time is not None:
max_sunset = self._replace_time(dt, self.max_sunset_time)
if max_sunset < sunset:
sunset = max_sunset
sunset = min(max_sunset, sunset)
return sunset
def _replace_time(
@ -131,21 +131,21 @@ class SunEvents:
noon = midnight + timedelta(hours=12) * (1 if midnight.hour < 12 else -1)
return noon, midnight
def sun_events(self, dt: datetime.datetime) -> list[tuple[str, float]]:
def sun_events(self, dt: datetime.datetime) -> list[tuple[SunEvent, float]]:
"""Get the four sun event's timestamps at 'dt'."""
sunrise = self.sunrise(dt)
sunset = self.sunset(dt)
solar_noon, solar_midnight = self.noon_and_midnight(dt, sunset, sunrise)
events = [
(SUN_EVENT_SUNRISE, sunrise.timestamp()),
(SUN_EVENT_SUNSET, sunset.timestamp()),
(SUN_EVENT_NOON, solar_noon.timestamp()),
(SUN_EVENT_MIDNIGHT, solar_midnight.timestamp()),
events: list[tuple[SunEvent, float]] = [
(SunEvent.SUNRISE, sunrise.timestamp()),
(SunEvent.SUNSET, sunset.timestamp()),
(SunEvent.NOON, solar_noon.timestamp()),
(SunEvent.MIDNIGHT, solar_midnight.timestamp()),
]
self._validate_sun_event_order(events)
return events
def _validate_sun_event_order(self, events: list[tuple[str, float]]) -> None:
def _validate_sun_event_order(self, events: list[tuple[SunEvent, float]]) -> None:
"""Check if the sun events are in the expected order."""
events = sorted(events, key=lambda x: x[1])
events_names, _ = zip(*events, strict=True)
@ -159,7 +159,10 @@ class SunEvents:
_LOGGER.error(msg)
raise ValueError(msg)
def prev_and_next_events(self, dt: datetime.datetime) -> list[tuple[str, float]]:
def prev_and_next_events(
self,
dt: datetime.datetime,
) -> list[tuple[SunEvent, float]]:
"""Get the previous and next sun event."""
events = [
event
@ -176,23 +179,26 @@ class SunEvents:
(_, prev_ts), (next_event, next_ts) = self.prev_and_next_events(dt)
h, x = (
(prev_ts, next_ts)
if next_event in (SUN_EVENT_SUNSET, SUN_EVENT_SUNRISE)
if next_event in (SunEvent.SUNSET, SunEvent.SUNRISE)
else (next_ts, prev_ts)
)
# k = -1 between sunset and sunrise (sun below horizon)
# k = 1 between sunrise and sunset (sun above horizon)
k = 1 if next_event in (SUN_EVENT_SUNSET, SUN_EVENT_NOON) else -1
k = 1 if next_event in (SunEvent.SUNSET, SunEvent.NOON) else -1
return k * (1 - ((target_ts - h) / (h - x)) ** 2)
def closest_event(self, dt: datetime.datetime) -> tuple[str, float]:
def closest_event(
self,
dt: datetime.datetime,
) -> tuple[Literal[SunEvent.SUNRISE, SunEvent.SUNSET], float]:
"""Get the closest sunset or sunrise event."""
(prev_event, prev_ts), (next_event, next_ts) = self.prev_and_next_events(dt)
if SUN_EVENT_SUNRISE in (prev_event, next_event):
ts_event = prev_ts if prev_event == SUN_EVENT_SUNRISE else next_ts
return SUN_EVENT_SUNRISE, ts_event
if SUN_EVENT_SUNSET in (prev_event, next_event):
ts_event = prev_ts if prev_event == SUN_EVENT_SUNSET else next_ts
return SUN_EVENT_SUNSET, ts_event
if SunEvent.SUNRISE in (prev_event, next_event):
ts_event = prev_ts if prev_event == SunEvent.SUNRISE else next_ts
return SunEvent.SUNRISE, ts_event
if SunEvent.SUNSET in (prev_event, next_event):
ts_event = prev_ts if prev_event == SunEvent.SUNSET else next_ts
return SunEvent.SUNSET, ts_event
msg = "No sunrise or sunset event found."
raise ValueError(msg)
@ -202,7 +208,7 @@ class SunLightSettings:
"""Track the state of the sun and associated light settings."""
name: str
astral_location: astral.Location
astral_location: astral.location.Location
adapt_until_sleep: bool
max_brightness: int
max_color_temp: int
@ -254,7 +260,7 @@ class SunLightSettings:
event, ts_event = self.sun.closest_event(dt)
dark = self.brightness_mode_time_dark.total_seconds()
light = self.brightness_mode_time_light.total_seconds()
if event == SUN_EVENT_SUNRISE:
if event == SunEvent.SUNRISE:
brightness = scaled_tanh(
dt.timestamp() - ts_event,
x1=-dark,
@ -264,7 +270,7 @@ class SunLightSettings:
y_min=self.min_brightness,
y_max=self.max_brightness,
)
elif event == SUN_EVENT_SUNSET:
elif event == SunEvent.SUNSET:
brightness = scaled_tanh(
dt.timestamp() - ts_event,
x1=-light, # shifted timestamp for the start of sunset
@ -274,6 +280,9 @@ class SunLightSettings:
y_min=self.min_brightness,
y_max=self.max_brightness,
)
else:
msg = "Unsupported sun event"
raise ValueError(msg)
return clamp(brightness, self.min_brightness, self.max_brightness)
def _brightness_pct_linear(self, dt: datetime.datetime) -> float:
@ -282,7 +291,7 @@ class SunLightSettings:
# at ts_event + dt_end, brightness == end_brightness
dark = self.brightness_mode_time_dark.total_seconds()
light = self.brightness_mode_time_light.total_seconds()
if event == SUN_EVENT_SUNRISE:
if event == SunEvent.SUNRISE:
brightness = lerp(
dt.timestamp() - ts_event,
x1=-dark,
@ -290,7 +299,7 @@ class SunLightSettings:
y1=self.min_brightness,
y2=self.max_brightness,
)
elif event == SUN_EVENT_SUNSET:
elif event == SunEvent.SUNSET:
brightness = lerp(
dt.timestamp() - ts_event,
x1=-light,
@ -298,9 +307,12 @@ class SunLightSettings:
y1=self.max_brightness,
y2=self.min_brightness,
)
else:
msg = "Unsupported sun event"
raise ValueError(msg)
return clamp(brightness, self.min_brightness, self.max_brightness)
def brightness_pct(self, dt: datetime.datetime, is_sleep: bool) -> float:
def brightness_pct(self, dt: datetime.datetime, is_sleep: bool) -> float | None:
"""Calculate the brightness in %."""
if is_sleep:
return self.sleep_brightness
@ -335,7 +347,7 @@ class SunLightSettings:
) -> dict[str, Any]:
"""Calculate the brightness and color."""
sun_position = self.sun.sun_position(dt)
rgb_color: tuple[float, float, float]
rgb_color: tuple[int, int, int]
# Variable `force_rgb_color` is needed for RGB color after sunset (if enabled)
force_rgb_color = False
brightness_pct = self.brightness_pct(dt, is_sleep)
@ -361,7 +373,8 @@ class SunLightSettings:
force_rgb_color = True
else:
color_temp_kelvin = self.color_temp_kelvin(sun_position)
rgb_color = color_temperature_to_rgb(color_temp_kelvin)
r, g, b = color_temperature_to_rgb(color_temp_kelvin)
rgb_color = (round(r), round(g), round(b))
# backwards compatibility for versions < 1.3.1 - see #403
color_temp_mired: float = math.floor(1000000 / color_temp_kelvin)
xy_color: tuple[float, float] = color_RGB_to_xy(*rgb_color)
@ -379,8 +392,8 @@ class SunLightSettings:
def get_settings(
self,
is_sleep,
transition,
is_sleep: bool,
transition: float | None,
) -> dict[str, float | int | tuple[float, float] | tuple[float, float, float]]:
"""Get all light settings.
@ -506,12 +519,12 @@ def lerp_color_hsv(
)
# Convert back to RGB
rgb = tuple(int(round(x * 255)) for x in colorsys.hsv_to_rgb(*hsv))
rgb = tuple(round(x * 255) for x in colorsys.hsv_to_rgb(*hsv))
assert all(0 <= x <= 255 for x in rgb), f"Invalid RGB color: {rgb}"
return cast(tuple[int, int, int], rgb)
return cast("tuple[int, int, int]", rgb)
def lerp(x, x1, x2, y1, y2):
def lerp(x: float, x1: float, x2: float, y1: float, y2: float) -> float:
"""Linearly interpolate between two values."""
return y1 + (x - x1) * (y2 - y1) / (x2 - x1)

View file

@ -1,12 +1,13 @@
"""Config flow for Adaptive Lighting integration."""
import logging
from typing import Any
import homeassistant.helpers.config_validation as cv
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_NAME
from homeassistant.core import callback
from homeassistant.helpers.selector import EntitySelector, EntitySelectorConfig
from .const import ( # pylint: disable=unused-import
CONF_LIGHTS,
@ -15,24 +16,64 @@ from .const import ( # pylint: disable=unused-import
NONE_STR,
VALIDATION_TUPLES,
)
from .switch import _supported_features, validate
from .switch import validate
_LOGGER = logging.getLogger(__name__)
OPTIONS_FLOW_DESCRIPTION_PLACEHOLDERS = {
"webapp_url": "https://basnijholt.github.io/adaptive-lighting",
"docs_url": "https://github.com/basnijholt/adaptive-lighting#readme",
}
class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
"""Handle a config flow for Adaptive Lighting."""
VERSION = 1
async def async_step_user(self, user_input=None):
source_options: dict[str, Any] | None = None
async def async_step_user(self, user_input: dict[str, Any] | None = None):
"""Handle the initial step."""
errors = {}
if user_input is None and self._async_current_entries():
return await self.async_step_menu()
return await self.async_step_wait_for_name(user_input)
async def async_step_menu(self, user_input: dict[str, Any] | None = None):
"""Handle the menu step."""
if user_input is not None:
if user_input["action"] != "new":
entry_id = user_input["action"]
entry = self.hass.config_entries.async_get_entry(entry_id)
if entry:
self.source_options = dict(entry.options)
return await self.async_step_wait_for_name()
entries = self._async_current_entries()
options = {"new": "Create new instance"}
for entry in entries:
options[entry.entry_id] = f"Duplicate '{entry.title}'"
return self.async_show_form(
step_id="menu",
data_schema=vol.Schema(
{vol.Required("action", default="new"): vol.In(options)},
),
)
async def async_step_wait_for_name(self, user_input: dict[str, Any] | None = None):
"""Handle the name step."""
errors: dict[str, str] = {}
if user_input is not None:
await self.async_set_unique_id(user_input[CONF_NAME])
self._abort_if_unique_id_configured()
return self.async_create_entry(title=user_input[CONF_NAME], data=user_input)
options = self.source_options
return self.async_create_entry(
title=user_input[CONF_NAME],
data=user_input,
options=options,
)
return self.async_show_form(
step_id="user",
@ -40,8 +81,11 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
errors=errors,
)
async def async_step_import(self, user_input=None):
async def async_step_import(self, user_input: dict[str, Any] | None = None):
"""Handle configuration by YAML file."""
if user_input is None:
return self.async_abort(reason="no_data")
await self.async_set_unique_id(user_input[CONF_NAME])
# Keep a list of switches that are configured via YAML
data = self.hass.data.setdefault(DOMAIN, {})
@ -56,12 +100,14 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
@staticmethod
@callback
def async_get_options_flow(config_entry):
def async_get_options_flow(
config_entry: config_entries.ConfigEntry, # noqa: ARG004
) -> "OptionsFlowHandler":
"""Get the options flow for this handler."""
return OptionsFlowHandler(config_entry)
return OptionsFlowHandler()
def validate_options(user_input, errors):
def validate_options(user_input: dict[str, Any], errors: dict[str, str]) -> None:
"""Validate the options in the OptionsFlow.
This is an extra validation step because the validators
@ -81,27 +127,24 @@ def validate_options(user_input, errors):
class OptionsFlowHandler(config_entries.OptionsFlow):
"""Handle a option flow for Adaptive Lighting."""
def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
"""Initialize options flow."""
self.config_entry = config_entry
async def async_step_init(self, user_input=None):
async def async_step_init(self, user_input: dict[str, Any] | None = None):
"""Handle options flow."""
conf = self.config_entry
data = validate(conf)
if conf.source == config_entries.SOURCE_IMPORT:
return self.async_show_form(step_id="init", data_schema=None)
errors = {}
return self.async_show_form(
step_id="init",
data_schema=None,
description_placeholders=OPTIONS_FLOW_DESCRIPTION_PLACEHOLDERS,
)
errors: dict[str, str] = {}
if user_input is not None:
validate_options(user_input, errors)
if not errors:
return self.async_create_entry(title="", data=user_input)
all_lights = [
light
for light in self.hass.states.async_entity_ids("light")
if _supported_features(self.hass, light)
]
# Validate that all configured lights still exist
all_lights = set(self.hass.states.async_entity_ids("light"))
for configured_light in data[CONF_LIGHTS]:
if configured_light not in all_lights:
errors = {CONF_LIGHTS: "entity_missing"}
@ -110,8 +153,15 @@ class OptionsFlowHandler(config_entries.OptionsFlow):
data[CONF_NAME],
configured_light,
)
all_lights.append(configured_light)
to_replace = {CONF_LIGHTS: cv.multi_select(sorted(all_lights))}
to_replace: dict[str, Any] = {
CONF_LIGHTS: EntitySelector(
EntitySelectorConfig(
domain="light",
multiple=True,
),
),
}
options_schema = {}
for name, default, validation in VALIDATION_TUPLES:
@ -123,4 +173,5 @@ class OptionsFlowHandler(config_entries.OptionsFlow):
step_id="init",
data_schema=vol.Schema(options_schema),
errors=errors,
description_placeholders=OPTIONS_FLOW_DESCRIPTION_PLACEHOLDERS,
)

View file

@ -1,5 +1,9 @@
"""Constants for the Adaptive Lighting integration."""
from datetime import timedelta
from enum import Enum
from typing import Any
import homeassistant.helpers.config_validation as cv
import voluptuous as vol
from homeassistant.components.light import VALID_TRANSITION
@ -13,6 +17,14 @@ ICON_SLEEP = "mdi:sleep"
DOMAIN = "adaptive_lighting"
class TakeOverControlMode(Enum):
"""Modes for pausing adaptation when control of a light is taken over externally."""
PAUSE_ALL = "pause_all"
PAUSE_CHANGED = "pause_changed"
DOCS = {CONF_ENTITY_ID: "Entity ID of the switch. 📝"}
@ -31,6 +43,7 @@ DOCS[CONF_DETECT_NON_HA_CHANGES] = (
"Needs `take_over_control` enabled. 🕵️ "
"Caution: ⚠️ Some lights might falsely indicate an 'on' state, which could result "
"in lights turning on unexpectedly. "
"Note that this calls `homeassistant.update_entity` every `interval`! "
"Disable this feature if you encounter such issues."
)
@ -82,9 +95,9 @@ CONF_ADAPT_ONLY_ON_BARE_TURN_ON, DEFAULT_ADAPT_ONLY_ON_BARE_TURN_ON = (
DOCS[CONF_ADAPT_ONLY_ON_BARE_TURN_ON] = (
"When turning lights on initially. If set to `true`, AL adapts only if `light.turn_on` is "
"invoked without specifying color or brightness. ❌🌈 "
"This e.g., prevents adaptation when activating a scene. "
"This e.g., prevents adaptation when activating a scene and marks the light as manually controlled. "
"If `false`, AL adapts regardless of the presence of color or brightness in the initial `service_data`. "
"Needs `take_over_control` enabled. 🕵️ "
"Needs `take_over_control` enabled. 🕵️"
)
CONF_PREFER_RGB_COLOR, DEFAULT_PREFER_RGB_COLOR = "prefer_rgb_color", False
@ -185,9 +198,19 @@ DOCS[CONF_BRIGHTNESS_MODE_TIME_LIGHT] = (
CONF_TAKE_OVER_CONTROL, DEFAULT_TAKE_OVER_CONTROL = "take_over_control", True
DOCS[CONF_TAKE_OVER_CONTROL] = (
"Disable Adaptive Lighting if another source calls `light.turn_on` while lights "
"are on and being adapted. Note that this calls `homeassistant.update_entity` "
"every `interval`! 🔒"
"Pause adaptation of individual lights and hand over (manual) control to other sources that "
"issue `light.turn_on` calls for lights that are on. 🔒"
)
CONF_TAKE_OVER_CONTROL_MODE, DEFAULT_TAKE_OVER_CONTROL_MODE = (
"take_over_control_mode",
TakeOverControlMode.PAUSE_ALL.value,
)
DOCS[CONF_TAKE_OVER_CONTROL_MODE] = (
"The adaptation pausing mode when other sources change brightness and/or color of lights. "
"`pause_all` always pauses both brightness and color adaptation. "
"`pause_changed` pauses the adaptation of only the changed attributes and continues adapting "
"unchanged attributes, e.g., continues color adaptation when only brightness was changed."
)
CONF_TRANSITION, DEFAULT_TRANSITION = "transition", 45
@ -281,8 +304,9 @@ DOCS_MANUAL_CONTROL = {
"light as being `manually controlled`. 📝",
CONF_LIGHTS: "entity_id(s) of lights, if not specified, all lights in the "
"switch are selected. 💡",
CONF_MANUAL_CONTROL: 'Whether to add ("true") or remove ("false") the '
'light from the "manual_control" list. 🔒',
CONF_MANUAL_CONTROL: 'Whether to add ("true") or remove ("false") all '
'adapted attributes of the light from the "manual_control" list, or the '
"name of an attribute for selective addition. 🔒",
}
DOCS_APPLY = {
@ -291,13 +315,13 @@ DOCS_APPLY = {
}
def int_between(min_int, max_int):
def int_between(min_int: int, max_int: int) -> vol.All:
"""Return an integer between 'min_int' and 'max_int'."""
return vol.All(vol.Coerce(int), vol.Range(min=min_int, max=max_int))
VALIDATION_TUPLES = [
(CONF_LIGHTS, DEFAULT_LIGHTS, cv.entity_ids),
VALIDATION_TUPLES: list[tuple[str, Any, Any]] = [
(CONF_LIGHTS, DEFAULT_LIGHTS, cv.entity_ids), # type: ignore[arg-type]
(CONF_INTERVAL, DEFAULT_INTERVAL, cv.positive_int),
(CONF_TRANSITION, DEFAULT_TRANSITION, VALID_TRANSITION),
(CONF_INITIAL_TRANSITION, DEFAULT_INITIAL_TRANSITION, VALID_TRANSITION),
@ -310,7 +334,7 @@ VALIDATION_TUPLES = [
(
CONF_SLEEP_RGB_OR_COLOR_TEMP,
DEFAULT_SLEEP_RGB_OR_COLOR_TEMP,
selector.SelectSelector(
selector.SelectSelector( # type: ignore[arg-type]
selector.SelectSelectorConfig(
options=["color_temp", "rgb_color"],
multiple=False,
@ -322,7 +346,7 @@ VALIDATION_TUPLES = [
(
CONF_SLEEP_RGB_COLOR,
DEFAULT_SLEEP_RGB_COLOR,
selector.ColorRGBSelector(selector.ColorRGBSelectorConfig()),
selector.ColorRGBSelector(selector.ColorRGBSelectorConfig()), # type: ignore[arg-type]
),
(CONF_SLEEP_TRANSITION, DEFAULT_SLEEP_TRANSITION, VALID_TRANSITION),
(CONF_ADAPT_UNTIL_SLEEP, DEFAULT_ADAPT_UNTIL_SLEEP, bool),
@ -337,7 +361,7 @@ VALIDATION_TUPLES = [
(
CONF_BRIGHTNESS_MODE,
DEFAULT_BRIGHTNESS_MODE,
selector.SelectSelector(
selector.SelectSelector( # type: ignore[arg-type]
selector.SelectSelectorConfig(
options=["default", "linear", "tanh"],
multiple=False,
@ -348,6 +372,20 @@ VALIDATION_TUPLES = [
(CONF_BRIGHTNESS_MODE_TIME_DARK, DEFAULT_BRIGHTNESS_MODE_TIME_DARK, int),
(CONF_BRIGHTNESS_MODE_TIME_LIGHT, DEFAULT_BRIGHTNESS_MODE_TIME_LIGHT, int),
(CONF_TAKE_OVER_CONTROL, DEFAULT_TAKE_OVER_CONTROL, bool),
(
CONF_TAKE_OVER_CONTROL_MODE,
DEFAULT_TAKE_OVER_CONTROL_MODE,
selector.SelectSelector( # type: ignore[arg-type]
selector.SelectSelectorConfig(
options=[
TakeOverControlMode.PAUSE_ALL.value,
TakeOverControlMode.PAUSE_CHANGED.value,
],
multiple=False,
mode=selector.SelectSelectorMode.DROPDOWN,
),
),
),
(CONF_DETECT_NON_HA_CHANGES, DEFAULT_DETECT_NON_HA_CHANGES, bool),
(
CONF_AUTORESET_CONTROL,
@ -370,7 +408,7 @@ VALIDATION_TUPLES = [
]
def timedelta_as_int(value):
def timedelta_as_int(value: timedelta) -> float:
"""Convert a `datetime.timedelta` object to an integer.
This integer can be serialized to json but a timedelta cannot.
@ -380,7 +418,7 @@ def timedelta_as_int(value):
# conf_option: (validator, coerce) tuples
# these validators cannot be serialized but can be serialized when coerced by coerce.
EXTRA_VALIDATION = {
EXTRA_VALIDATION: dict[str, tuple[Any, Any]] = {
CONF_INTERVAL: (cv.time_period, timedelta_as_int),
CONF_SUNRISE_OFFSET: (cv.time_period, timedelta_as_int),
CONF_SUNRISE_TIME: (cv.time, str),
@ -395,7 +433,7 @@ EXTRA_VALIDATION = {
}
def maybe_coerce(key, validation):
def maybe_coerce(key: str, validation: Any) -> vol.All | Any:
"""Coerce the validation into a json serializable type."""
validation, coerce = EXTRA_VALIDATION.get(key, (validation, None))
if coerce is not None:
@ -403,7 +441,7 @@ def maybe_coerce(key, validation):
return validation
def replace_none_str(value, replace_with=None):
def replace_none_str(value: Any, replace_with: Any | None = None) -> Any:
"""Replace "None" -> replace_with."""
return value if value != NONE_STR else replace_with
@ -421,12 +459,12 @@ _DOMAIN_SCHEMA = vol.Schema(
)
def apply_service_schema(initial_transition: int = 1):
def apply_service_schema(initial_transition: int = 1) -> vol.Schema:
"""Return the schema for the apply service."""
return vol.Schema(
{
vol.Optional(CONF_ENTITY_ID): cv.entity_ids,
vol.Optional(CONF_LIGHTS, default=[]): cv.entity_ids,
vol.Optional(CONF_ENTITY_ID): cv.entity_ids, # type: ignore[arg-type]
vol.Optional(CONF_LIGHTS, default=[]): cv.entity_ids, # type: ignore[arg-type]
vol.Optional(
CONF_TRANSITION,
default=initial_transition,
@ -441,8 +479,11 @@ def apply_service_schema(initial_transition: int = 1):
SET_MANUAL_CONTROL_SCHEMA = vol.Schema(
{
vol.Optional(CONF_ENTITY_ID): cv.entity_ids,
vol.Optional(CONF_LIGHTS, default=[]): cv.entity_ids,
vol.Optional(CONF_MANUAL_CONTROL, default=True): cv.boolean,
vol.Optional(CONF_ENTITY_ID): cv.entity_ids, # type: ignore[arg-type]
vol.Optional(CONF_LIGHTS, default=[]): cv.entity_ids, # type: ignore[arg-type]
vol.Optional(CONF_MANUAL_CONTROL, default=True): vol.Any(
cv.boolean,
vol.In(["brightness", "color"]),
),
},
)

View file

@ -0,0 +1,35 @@
"""Documentation generation utilities for Adaptive Lighting.
Provides functions to transform content for the documentation site.
Used by markdown-code-runner to generate documentation pages from README content.
"""
from __future__ import annotations
import re
def _transform_readme_links(content: str) -> str:
"""Transform README internal links to docs site links."""
# Map README anchors to doc pages
link_map = {
"#gear-configuration": "configuration.md",
"#memo-options": "configuration.md#all-options",
"#hammer_and_wrench-services": "services.md",
"#adaptive_lightingapply": "services.md#adaptive_lightingapply",
"#adaptive_lightingset_manual_control": "services.md#adaptive_lightingset_manual_control",
"#adaptive_lightingchange_switch_settings": "services.md#adaptive_lightingchange_switch_settings",
"#robot-automation-examples": "automation-examples.md",
"#sos-troubleshooting": "troubleshooting.md",
"#exclamation-common-problems--solutions": "troubleshooting.md#common-problems-solutions",
"#bar_chart-graphs": "advanced/brightness-modes.md#graphs",
"#bulb-features": "index.md#features",
"#control_knobs-regain-manual-control": "advanced/manual-control.md",
"#eyes-see-also": "see-also.md",
}
for old_link, new_link in link_map.items():
content = content.replace(f"]({old_link})", f"]({new_link})")
# Remove ToC link pattern [[ToC](#...)]
return re.sub(r"\[\[ToC\]\([^)]+\)\]", "", content)

View file

@ -4,6 +4,7 @@ import logging
from collections.abc import Awaitable, Callable
from homeassistant.core import HomeAssistant, ServiceCall
from homeassistant.helpers import device_registry, entity_registry
from homeassistant.util.read_only_dict import ReadOnlyDict
from .adaptation_utils import ServiceData
@ -11,6 +12,25 @@ from .adaptation_utils import ServiceData
_LOGGER = logging.getLogger(__name__)
def area_entities(hass: HomeAssistant, area_id: str):
"""Get all entities linked to an area."""
ent_reg = entity_registry.async_get(hass)
entity_ids = [
entry.entity_id
for entry in entity_registry.async_entries_for_area(ent_reg, area_id)
]
dev_reg = device_registry.async_get(hass)
entity_ids.extend(
[
entity.entity_id
for device in device_registry.async_entries_for_area(dev_reg, area_id)
for entity in entity_registry.async_entries_for_device(ent_reg, device.id)
if entity.area_id is None
],
)
return entity_ids
def setup_service_call_interceptor(
hass: HomeAssistant,
domain: str,
@ -27,7 +47,7 @@ def setup_service_call_interceptor(
# This is necessary to replace a registered service handler with our
# proxy handler to intercept calls.
registered_services = (
hass.services._services # pylint: disable=protected-access
hass.services._services # pylint: disable=protected-access # type: ignore[attr-defined]
)
except AttributeError as error:
msg = (
@ -48,7 +68,9 @@ def setup_service_call_interceptor(
data = dict(call.data)
# Call interceptor
await intercept_func(call, data)
result = intercept_func(call, data)
if result is not None:
await result
# Convert data back to read-only
call.data = ReadOnlyDict(data)
@ -59,7 +81,13 @@ def setup_service_call_interceptor(
call.data,
)
# Call original service handler with processed data
await existing_service.job.target(call)
import asyncio
target = existing_service.job.target
if asyncio.iscoroutinefunction(target):
await target(call)
else:
target(call)
hass.services.async_register(
domain,
@ -68,7 +96,7 @@ def setup_service_call_interceptor(
existing_service.schema,
)
def remove():
def remove() -> None:
# Remove the interceptor by reinstalling the original service handler
hass.services.async_register(
domain,

View file

@ -4,6 +4,10 @@ from __future__ import annotations
import base64
import math
from typing import TYPE_CHECKING, Any
if TYPE_CHECKING:
from homeassistant.core import HomeAssistant
def clamp(value: float, minimum: float, maximum: float) -> float:
@ -83,3 +87,12 @@ def color_difference_redmean(
green_term = 4 * delta_g**2
blue_term = (2 + (255 - r_hat) / 256) * delta_b**2
return math.sqrt(red_term + green_term + blue_term)
def get_friendly_name(hass: HomeAssistant, entity_id: str) -> str:
"""Retrieve the friendly name of an entity."""
state = hass.states.get(entity_id)
if state and hasattr(state, "attributes"):
attributes: dict[str, Any] = dict(getattr(state, "attributes", {}))
return attributes.get("friendly_name", entity_id)
return entity_id

View file

@ -8,5 +8,5 @@
"iot_class": "calculated",
"issue_tracker": "https://github.com/basnijholt/adaptive-lighting/issues",
"requirements": ["ulid-transform"],
"version": "1.22.0"
"version": "1.30.1"
}

View file

@ -57,7 +57,7 @@ set_manual_control:
domain: light
multiple: true
manual_control:
description: Whether to add ("true") or remove ("false") the light from the "manual_control" list. 🔒
description: Whether to add ("true") or remove ("false") all adapted attributes of the light from the "manual_control" list, or the name of an attribute for selective addition. 🔒
example: true
default: true
selector:
@ -220,13 +220,22 @@ change_switch_settings:
selector:
time: null
take_over_control:
description: Disable Adaptive Lighting if another source calls `light.turn_on` while lights are on and being adapted. Note that this calls `homeassistant.update_entity` every `interval`! 🔒
description: Pause adaptation of individual lights and hand over (manual) control to other sources that issue `light.turn_on` calls for lights that are on. 🔒
required: false
example: true
selector:
boolean: null
take_over_control_mode:
description: The adaptation pausing mode when other sources change brightness and/or color of lights. `pause_all` always pauses both brightness and color adaptation. `pause_changed` pauses the adaptation of only the changed attributes and continues adapting unchanged attributes, e.g., continues color adaptation when only brightness was changed.
required: false
example: pause_changed
selector:
select:
options:
- pause_all
- pause_changed
detect_non_ha_changes:
description: 'Detects and halts adaptations for non-`light.turn_on` state changes. Needs `take_over_control` enabled. 🕵️ Caution: ⚠️ Some lights might falsely indicate an ''on'' state, which could result in lights turning on unexpectedly. Disable this feature if you encounter such issues.'
description: 'Detects and halts adaptations for non-`light.turn_on` state changes. Needs `take_over_control` enabled. 🕵️ Caution: ⚠️ Some lights might falsely indicate an ''on'' state, which could result in lights turning on unexpectedly. Note that this calls `homeassistant.update_entity` every `interval`! Disable this feature if you encounter such issues.'
required: false
example: false
selector:

View file

@ -7,6 +7,13 @@
"data": {
"name": "Name"
}
},
"menu": {
"title": "Create or Duplicate",
"description": "Do you want to create a new instance or duplicate an existing one?",
"data": {
"action": "Action"
}
}
},
"abort": {
@ -17,7 +24,7 @@
"step": {
"init": {
"title": "Adaptive Lighting options",
"description": "Configure an Adaptive Lighting component. Option names align with the YAML settings. If you've defined this entry in YAML, no options will appear here. For interactive graphs that demonstrate parameter effects, visit [this web app](https://basnijholt.github.io/adaptive-lighting). For further details, see the [official documentation](https://github.com/basnijholt/adaptive-lighting#readme).",
"description": "Configure an Adaptive Lighting component. Option names align with the YAML settings. If you've defined this entry in YAML, no options will appear here. For interactive graphs that demonstrate parameter effects, visit [this web app]({webapp_url}). For further details, see the [official documentation]({docs_url}).",
"data": {
"lights": "lights: List of light entity_ids to be controlled (may be empty). 🌟",
"interval": "interval",
@ -45,11 +52,12 @@
"brightness_mode": "brightness_mode",
"brightness_mode_time_dark": "brightness_mode_time_dark",
"brightness_mode_time_light": "brightness_mode_time_light",
"take_over_control": "take_over_control: Disable Adaptive Lighting if another source calls `light.turn_on` while lights are on and being adapted. Note that this calls `homeassistant.update_entity` every `interval`! 🔒",
"detect_non_ha_changes": "detect_non_ha_changes: Detects and halts adaptations for non-`light.turn_on` state changes. Needs `take_over_control` enabled. 🕵️ Caution: ⚠️ Some lights might falsely indicate an 'on' state, which could result in lights turning on unexpectedly. Disable this feature if you encounter such issues.",
"take_over_control": "take_over_control: Pause adaptation of individual lights and hand over (manual) control to other sources that issue `light.turn_on` calls for lights that are on. 🔒",
"take_over_control_mode": "take_over_control_mode",
"detect_non_ha_changes": "detect_non_ha_changes: Detects and halts adaptations for non-`light.turn_on` state changes. Needs `take_over_control` enabled. 🕵️ Caution: ⚠️ Some lights might falsely indicate an 'on' state, which could result in lights turning on unexpectedly. Note that this calls `homeassistant.update_entity` every `interval`! Disable this feature if you encounter such issues.",
"autoreset_control_seconds": "autoreset_control_seconds",
"only_once": "only_once: Adapt lights only when they are turned on (`true`) or keep adapting them (`false`). 🔄",
"adapt_only_on_bare_turn_on": "adapt_only_on_bare_turn_on: When turning lights on initially. If set to `true`, AL adapts only if `light.turn_on` is invoked without specifying color or brightness. ❌🌈 This e.g., prevents adaptation when activating a scene. If `false`, AL adapts regardless of the presence of color or brightness in the initial `service_data`. Needs `take_over_control` enabled. 🕵️ ",
"adapt_only_on_bare_turn_on": "adapt_only_on_bare_turn_on: When turning lights on initially. If set to `true`, AL adapts only if `light.turn_on` is invoked without specifying color or brightness. ❌🌈 This e.g., prevents adaptation when activating a scene and marks the light as manually controlled. If `false`, AL adapts regardless of the presence of color or brightness in the initial `service_data`. Needs `take_over_control` enabled. 🕵️",
"separate_turn_on_commands": "separate_turn_on_commands: Use separate `light.turn_on` calls for color and brightness, needed for some light types. 🔀",
"send_split_delay": "send_split_delay",
"adapt_delay": "adapt_delay",
@ -78,6 +86,7 @@
"brightness_mode": "Brightness mode to use. Possible values are `default`, `linear`, and `tanh` (uses `brightness_mode_time_dark` and `brightness_mode_time_light`). 📈",
"brightness_mode_time_dark": "(Ignored if `brightness_mode='default'`) The duration in seconds to ramp up/down the brightness before/after sunrise/sunset. 📈📉",
"brightness_mode_time_light": "(Ignored if `brightness_mode='default'`) The duration in seconds to ramp up/down the brightness after/before sunrise/sunset. 📈📉.",
"take_over_control_mode": "The adaptation pausing mode when other sources change brightness and/or color of lights. `pause_all` always pauses both brightness and color adaptation. `pause_changed` pauses the adaptation of only the changed attributes and continues adapting unchanged attributes, e.g., continues color adaptation when only brightness was changed.",
"autoreset_control_seconds": "Automatically reset the manual control after a number of seconds. Set to 0 to disable. ⏲️",
"send_split_delay": "Delay (ms) between `separate_turn_on_commands` for lights that don't support simultaneous brightness and color setting. ⏲️",
"adapt_delay": "Wait time (seconds) between light turn on and Adaptive Lighting applying changes. Might help to avoid flickering. ⏲️"
@ -137,7 +146,7 @@
"name": "lights"
},
"manual_control": {
"description": "Whether to add (\"true\") or remove (\"false\") the light from the \"manual_control\" list. 🔒",
"description": "Whether to add (\"true\") or remove (\"false\") all adapted attributes of the light from the \"manual_control\" list, or the name of an attribute for selective addition. 🔒",
"name": "manual_control"
}
}
@ -243,11 +252,15 @@
"name": "min_sunset_time"
},
"take_over_control": {
"description": "Disable Adaptive Lighting if another source calls `light.turn_on` while lights are on and being adapted. Note that this calls `homeassistant.update_entity` every `interval`! 🔒",
"description": "Pause adaptation of individual lights and hand over (manual) control to other sources that issue `light.turn_on` calls for lights that are on. 🔒",
"name": "take_over_control"
},
"take_over_control_mode": {
"description": "The adaptation pausing mode when other sources change brightness and/or color of lights. `pause_all` always pauses both brightness and color adaptation. `pause_changed` pauses the adaptation of only the changed attributes and continues adapting unchanged attributes, e.g., continues color adaptation when only brightness was changed.",
"name": "take_over_control_mode"
},
"detect_non_ha_changes": {
"description": "Detects and halts adaptations for non-`light.turn_on` state changes. Needs `take_over_control` enabled. 🕵️ Caution: ⚠️ Some lights might falsely indicate an 'on' state, which could result in lights turning on unexpectedly. Disable this feature if you encounter such issues.",
"description": "Detects and halts adaptations for non-`light.turn_on` state changes. Needs `take_over_control` enabled. 🕵️ Caution: ⚠️ Some lights might falsely indicate an 'on' state, which could result in lights turning on unexpectedly. Note that this calls `homeassistant.update_entity` every `interval`! Disable this feature if you encounter such issues.",
"name": "detect_non_ha_changes"
},
"transition": {

File diff suppressed because it is too large Load diff

View file

@ -18,7 +18,7 @@
"step": {
"init": {
"title": "Настройки на Адаптивно осветление",
"description": "Конфигурирайте компонент за Адаптивно осветление. Имената на опциите съвпадат с настройките на YAML. Ако сте дефинирали този запис в YAML, няма да се появят опции тук. За интерактивни графики, които демонстрират ефектите на параметрите, посетете [това уеб приложение](https://basnijholt.github.io/adaptive-lighting). За повече подробности, вижте [официалната документация](https://github.com/basnijholt/adaptive-lighting#readme).",
"description": "Конфигурирайте компонент за Адаптивно осветление. Имената на опциите съвпадат с настройките на YAML. Ако сте дефинирали този запис в YAML, няма да се появят опции тук. За интерактивни графики, които демонстрират ефектите на параметрите, посетете [това уеб приложение]({webapp_url}). За повече подробности, вижте [официалната документация]({docs_url}).",
"data": {
"lights": "lights: Списък от entity_ids на лампи за контрол (може да е празен). 🌟",
"interval": "интервал",

View file

@ -4,22 +4,54 @@
"step": {
"init": {
"data_description": {
"initial_transition": "Durada de la primera transició quan els llums s'encenen de `off` a `on` en segons. ⏲️",
"initial_transition": "Durada de la primera transició quan els llums canvien de `off` a `on` en segons. ⏲️",
"sunset_offset": "Ajusta l'hora de la posta del sol amb una compensació positiva o negativa en segons. ⏰",
"send_split_delay": "Retard (ms) entre `separate_turn_on_commands` per als llums que no admeten la configuració simultània de brillantor i color. ⏲️",
"sunrise_offset": "Ajusta l'hora de sortida del sol amb una compensació positiva o negativa en segons. ⏰",
"autoreset_control_seconds": "Restableix automàticament el control manual al cap d'uns segons. Posar a 0 per desactivar. ⏲️",
"brightness_mode": "Mode de brillantor a utilitzar. Els valors possibles són `default`, \"linear\" i \"tanh\" (utilitza `brightness_mode_time_dark` i `brightness_mode_time_light`). 📈",
"sleep_color_temp": "Temperatura de color en mode nit (s'utilitza quan `sleep_rgb_or_color_temp` és `color_temp`) en Kelvin. 😴",
"sleep_brightness": "Percentatge de brillantor de les llums en mode nit. 😴"
"sleep_color_temp": "Temperatura de color en mode nocturn (s'utilitza quan `sleep_rgb_or_color_temp` és `color_temp`) en Kelvin. 😴",
"sleep_brightness": "Percentatge de brillantor dels llums en mode nocturn. 😴",
"interval": "Freqüència d'adaptació de les llums, en segons. 🔄",
"sleep_transition": "Durada de la transició en commutar el \"mode nocturn\", en segons. 🕑",
"sleep_rgb_color": "Color RGB en mode nocturn (s'utilitza quan `sleep_rgb_or_color_temp` és \"rgb_color\"). 🌈",
"transition": "Durada de la transició en canviar les llums, en segons. 🕑",
"sunrise_time": "Indica una hora fixa (HH:MM:SS) per a la sortida del sol. 🌅",
"sleep_rgb_or_color_temp": "Utilitza `\"rgb_color\"` o `\"color_temp\"` durant el mode nocturn. 🌙",
"sunset_time": "Indica una hora fixa (HH:MM:SS) per a la posta de sol. 🌇",
"brightness_mode_time_dark": "(S'ignora si `brightness_mode='default'`) La durada en segons de la variació de la brillantor abans/despres de la sortida/posta de sol. 📈📉.",
"brightness_mode_time_light": "(S'ignora si `brightness_mode='default'`) La durada en segons de la variació de la brillantor abans/despres de la sortida/posta de sol. 📈📉.",
"adapt_delay": "Temps d'espera (en segons) entre l'encesa de la llum i els canvis per part d'Adaptive Lighting. Pot ajudar a evitar els parpalleigs. ⏲️",
"min_sunrise_time": "Defineix la sortida de sol virtual més primerenca (HH:MM:SS), tot permetent sortides de sol posteriors. 🌅",
"max_sunrise_time": "Defineix la sortida de sol virtual més tardana (HH:MM:SS), tot permetent sortides de sol abans. 🌅",
"max_sunset_time": "Defineix la sortida virtual de sol virtual més tardana (HH:MM:SS), tot permetent sortides de sol abans. 🌇",
"min_sunset_time": "Defineix la posta de sol virtual més primerenca (HH:MM:SS), tot permetent postes de sol més tard. 🌇"
},
"title": "Opcions Il·luminació Adaptativa",
"data": {
"adapt_only_on_bare_turn_on": "adapt_only_on_bare_turn_on: Quan s'encenen les llums inicialment. Si el valor és `true`, AL adapta només si s'ha cridat `light.turn_on` sense especificar color o brillantor. ❌🌈 Això impedeix l'adaptació quan s'activa una escena. Si el valor és `false`, AL adapta independentment de la presencia de color o brillantor en les dades inicials `service_data`. Necessita `take_over_control` habilitat. 🕵️ ",
"detect_non_ha_changes": "detect_non_ha_changes: Detecta i atura les adaptacions per als canvis d'estat diferents a `light.turn_on`. Necessita `take_over_control` habilitat. 🕵️ Precaució: ⚠️ Alguns llums poden indicar falsament un estat \"encès\", cosa que podria provocar que els llums s'encenguessin inesperadament. Desactiva aquesta funció si trobes aquests problemes."
"adapt_only_on_bare_turn_on": "adapt_only_on_bare_turn_on: Quan s'encenen les llums inicialment. Si el valor és `true`, AL adapta només si s'ha cridat `light.turn_on` sense especificar color o brillantor. ❌🌈 Això impedeix l'adaptació quan s'activa una escena. Si el valor és `false`, AL adapta independentment de la presencia de color o brillantor en les dades inicials `service_data`. Necessita `take_over_control` habilitat. 🕵️",
"detect_non_ha_changes": "detect_non_ha_changes: Detecta i atura les adaptacions per als canvis d'estat diferents a `light.turn_on`. Necessita que `take_over_control` estigui habilitat. 🕵️ Precaució: ⚠️ Alguns llums poden indicar falsament un estat \"encès\", cosa que podria provocar que els llums s'encenguin inesperadament. Desactiva aquesta funció si trobes aquests problemes.",
"lights": "lights: Llista d'entity_ids dels llums a controlar (pot estar buida). 🌟",
"min_brightness": "min_brightness: Percentatge mínim de brillantor. 💡",
"max_brightness": "max_brightness: Percentatge màxim de brillantor. 💡",
"min_color_temp": "min_color_temp: Temperatura de color més càlida en graus Kelvin. 🔥",
"max_color_temp": "max_color_temp: Temperatura de color més freda en graus Kelvin. ❄️",
"prefer_rgb_color": "prefer_rgb_color: Si prefereixes l'ajustament del color RGB en lloc de la temperatura de color, quan sigui possible. 🌈",
"take_over_control": "take_over_control: Inhabilita Adaptive Lighting si una altra font crida `light.turn_on` quan les llums estan enceses i en procés d'adaptació. Tingues present que això cridarà `homeassistant.update_entity` cada `interval`! 🔒",
"only_once": "only_once: Adapta els llums només quan s'encenen (`true`) o segueix adaptant-les (`false`). 🔄",
"separate_turn_on_commands": "separate_turn_on_commands: Separa les crides de `light.turn_on` per a color i brillantor; necessari per alguns tipus de llums. 🔀",
"include_config_in_attributes": "include_config_in_attributes: Mostra totes les opcions com atributs a l'interruptor de Home Assistant quan s'estableix com a `true`. 📝",
"multi_light_intercept": "multi_light_intercept: Intercepta i adapta les crides `light.turn_on` dirigides a múltiples llums. ➗⚠️ Pot provocar la divisió d'una crida única `light.turn_on` en múltiples crides, com ara, quan les llums són en interruptors diferents. Necessita que `intercept` estigui habilitat.",
"transition_until_sleep": "transition_until_sleep: Si s'activa, Adaptive Lighting considerarà els ajustaments del mode nocturn com a mínims, fent una transició cap aquests valors després de la posta de sol. 🌙",
"intercept": "intercept: Intercepta i adapta les crides `light.turn_on` per permetre canvis instantanis de color i brillantor. 🏎️ Inhabilita-ho per a llums que no admeten `light.turn_on` amb color i brillantor.",
"skip_redundant_commands": "skip_redundant_commands: Evita l'enviament de d'ordres d'adaptació als objectius on el seu estat ja és el conegut del llum. Minimitza el trànsit de la xarxa i millora la resposta de l'adaptació en alguns casos. 📉 Inhabilita-ho si l'estat físic del llum queda desincronitzat amb l'estat registrat a Home Assistant."
},
"description": "Configura un component d'Adaptive Lighting. Els noms de les opcions s'alineen amb la configuració de YAML. Si has definit aquesta entrada a YAML, aquí no apareixerà cap opció. Per veure gràfics interactius que demostren efectes de paràmetres, visita [aquesta aplicació web] (https://basnijholt.github.io/adaptive-lighting). Per a més detalls, pots veure la [documentació oficial] (https://github.com/basnijholt/adaptive-lighting#readme)."
"description": "Configura un component d'Adaptive Lighting. Els noms de les opcions s'alineen amb la configuració de YAML. Si has definit aquesta entrada a YAML, aquí no apareixerà cap opció. Per veure gràfics interactius que demostren efectes de paràmetres, visita [aquesta aplicació web]({webapp_url}). Per a més detalls, pots veure la [documentació oficial]({docs_url})."
}
},
"error": {
"option_error": "Opció invàlida",
"entity_missing": "Una o més de les entitats de llum seleccionades no es troba a Home Assistant"
}
},
"services": {
@ -29,7 +61,7 @@
"description": "Ajustar les llums només quan s'encenguin (`true`) o ajustar contínuament(`false`). 🔄"
},
"sleep_color_temp": {
"description": "Temperatura de color en mode nit (s'utilitza quan `sleep_rgb_or_color_temp` és `color_temp`) en Kelvin. 😴"
"description": "Temperatura de color en mode nocturn (s'utilitza quan `sleep_rgb_or_color_temp` és `color_temp`) en Kelvin. 😴"
},
"sunrise_offset": {
"description": "Ajusta l'hora de sortida del sol amb una compensació positiva o negativa en segons. ⏰"
@ -41,7 +73,7 @@
"description": "Restableix automàticament el control manual al cap d'uns segons. Posar a 0 per desactivar. ⏲️"
},
"sleep_brightness": {
"description": "Percentatge de brillantor de les llums en mode nit. 😴"
"description": "Percentatge de brillantor dels llums en mode nocturn. 😴"
},
"max_color_temp": {
"description": "Temperatura de color més freda en Kelvin. ❄️"
@ -50,10 +82,67 @@
"description": "Retard (ms) entre `separate_turn_on_commands` per als llums que no admeten la configuració simultània de brillantor i color. ⏲️"
},
"detect_non_ha_changes": {
"description": "Detecta i atura les adaptacions per als canvis d'estat diferents a `light.turn_on`. Necessita `take_over_control` habilitat. 🕵️ Precaució: ⚠️ Alguns llums poden indicar falsament un estat \"encès\", cosa que podria provocar que els llums s'encenguessin inesperadament. Desactiva aquesta funció si trobes aquests problemes."
"description": "Detecta i atura les adaptacions per als canvis d'estat diferents a `light.turn_on`. Necessita que `take_over_control` estigui habilitat. 🕵️ Precaució: ⚠️ Alguns llums poden indicar falsament un estat \"encès\", cosa que podria provocar que els llums s'encenguin inesperadament. Desactiva aquesta funció si trobes aquests problemes."
},
"take_over_control": {
"description": "Desactiva Adaptive Lighting si una altra font crida `light.turn_on` mentre els llums estan encesos i adaptats. Tingues en compte que això crida `homeassistant.update_entity` cada `interval`! 🔒"
},
"entity_id": {
"description": "ID de la entitat de l'interruptor. 📝"
},
"turn_on_lights": {
"description": "Si s'encenen les llums que estan apagades en aquest moment. 🔆"
},
"initial_transition": {
"description": "Durada de la primera transició quan els llums canvien `off` a `on` en segons. ⏲️"
},
"sleep_transition": {
"description": "Durada de la transició en commutar el \"mode nocturn\", en segons. 🕑"
},
"max_brightness": {
"description": "Percentatge màxim de brillantor. 💡"
},
"min_brightness": {
"description": "Percentatge mínim de brillantor. 💡"
},
"prefer_rgb_color": {
"description": "Si es prefereix ajustar el color RGB en lloc de la temperatura de color, quan sigui possible. 🌈"
},
"min_color_temp": {
"description": "Temperatura de color més càlida, en graus Kelvin. 🔥"
},
"separate_turn_on_commands": {
"description": "Utilitza crides independents per a `light.turn_on` per color i brillantor; necessari per alguns tipus de llums. 🔀"
},
"sleep_rgb_or_color_temp": {
"description": "Utilitza `\"rgb_color\"` o `\"color_temp\"` durant el mode nocturn. 🌙"
},
"sleep_rgb_color": {
"description": "Color RGB en mode nocturn (s'utilitza quan `sleep_rgb_or_color_temp` és \"rgb_color\"). 🌈"
},
"sunrise_time": {
"description": "Indica una hora fixa (HH:MM:SS) per a la sortida del sol. 🌅"
},
"sunset_time": {
"description": "Indica una hora fixa (HH:MM:SS) per a la posta de sol. 🌇"
},
"transition": {
"description": "Durada de la transició en canviar les llums, en segons. 🕑"
},
"adapt_delay": {
"description": "Temps d'espera (en segons) entre l'encesa de la llum i els canvis per part d'Adaptive Lighting. Pot ajudar a evitar els parpalleigs. ⏲️"
},
"use_defaults": {
"description": "Defineix els valors per defecte que no s'especifiquin a la crida del servei. Opcions: \"current\" (per defecte, manté els valors actuals), \"factory\" (restaura els valors documentats per defecte), o \"configuration\" (retorna als valors per defecte de l'interruptor). ⚙️"
},
"include_config_in_attributes": {
"description": "Mostra totes les opcions com a atributs de l'interruptor a Home Assistant quan es defineixi com a `true`. 📝"
},
"max_sunrise_time": {
"description": "Defineix la sortida de sol virtual més tardana (HH:MM:SS), tot permetent sortides de sol abans. 🌅"
},
"min_sunset_time": {
"description": "Defineix la posta de sol virtual més primerenca (HH:MM:SS), tot permetent postes de sol més tard. 🌇"
}
},
"description": "Canvia les opcions de configuració que vulguis al commutador. Totes les opcions d'aquí són les mateixes que en el flux de configuració."
@ -62,16 +151,59 @@
"fields": {
"lights": {
"description": "Una llum (o una llista de llums) a la qual aplicar la configuració. 💡"
},
"transition": {
"description": "Durada de la transició en canviar les llums, en segons. 🕑"
},
"prefer_rgb_color": {
"description": "Si es prefereix ajustar el color RGB en lloc de la temperatura de color, quan sigui possible. 🌈"
},
"turn_on_lights": {
"description": "Si s'encenen les llums que estan apagades en aquest moment. 🔆"
},
"entity_id": {
"description": "L'`entity_id` de l'interruptor amb els paràmetres per aplicar. 📝"
},
"adapt_brightness": {
"description": "Si cal adaptar la brillantor del llum. 🌞"
},
"adapt_color": {
"description": "Si cal adaptar el color a les llums que ho admetin. 🌈"
}
},
"description": "Aplica la configuració actual d'Adaptive Lighting a les llums."
},
"set_manual_control": {
"description": "Indica quan una llum està 'controlada manualment'.",
"fields": {
"lights": {
"description": "entity_id(s) de les llums; si no s'especifica es seleccionaran totes les llums de l'interruptor. 💡"
},
"entity_id": {
"description": "L'`entity_id` de l'interruptor al qual (des)marcar el llum com a `manually controlled`. 📝"
},
"manual_control": {
"description": "Si cal afegir (\"true\") o treure (\"false\") el llum de la llista de \"manual_control\". 🔒"
}
}
}
},
"config": {
"step": {
"user": {
"title": "Tria un nom per a la instància d'Adaptive Lighting"
"title": "Tria un nom per a la instància d'Adaptive Lighting",
"description": "Cada instància pot contenir múltiples llums!"
},
"menu": {
"title": "Crear o Duplicar",
"description": "Vols crear una nova instància, o duplicar-ne una d'existent?",
"data": {
"action": "Acció"
}
}
},
"abort": {
"already_configured": "Aquest dispositiu ja està configurat"
}
}
}

View file

@ -40,7 +40,11 @@
"detect_non_ha_changes": "detect_non_ha_changes: Registrer alle ændringer på >10% på et lys (også udenfor HA), kræver at 'take_over_control' er slået til (kalder 'homeassistant.update_entity' hvert 'interval'!)",
"transition": "Overgangsperiode når en ændring i lyset udføres (i sekunder)",
"transition_until_sleep": "overgang_til_sove: Når aktiveret, vil adaptiv belysning behandle søvnindstillinger som minimum, og overgår til disse værdier efter solnedgang. 🌙",
"adapt_only_on_bare_turn_on": "tilpas_kun_ved_enkelt_tænd: Når du tænder lys for første gang. Hvis indstillet til 'true', tilpasser AL kun, hvis 'lys.tænd' er kaldt uden at angive farve eller lysstyrke. ❌🌈 Dette forhindrer f.eks. tilpasning, når du aktiverer en scene. Hvis indstillet til 'false' tilpasser AL sig uanset tilstanden af farve eller lysstyrke i den oprindelige 'service_data'. Har brug for at 'take_over_control' er aktiveret. 🕵️ "
"adapt_only_on_bare_turn_on": "tilpas_kun_ved_enkelt_tænd: Når du tænder lys for første gang. Hvis indstillet til 'true', tilpasser AL kun, hvis 'lys.tænd' er kaldt uden at angive farve eller lysstyrke. ❌🌈 Dette forhindrer f.eks. tilpasning, når du aktiverer en scene. Hvis indstillet til 'false' tilpasser AL sig uanset tilstanden af farve eller lysstyrke i den oprindelige 'service_data'. Har brug for at 'take_over_control' er aktiveret. 🕵️",
"include_config_in_attributes": "include_config_in_attributes: Vis alle indstillinger som attributter for kontakten når dette er sat til »true«. 📝",
"skip_redundant_commands": "skip_redundant_commands: Undlad at sende tilpasningskommando, hvis lampens kendte tilstand allerede er lig den ønskede tilstand. Mindsker mængden af netværkstrafik og forbedrer tilpasningens responsivitet i visse situationer. 📉 Slå fra, hvis lampens faktiske tilstand kommer ud af takt med den tilstand, som HA rapporterer.",
"intercept": "intercept: Indfang og tilpas »light.turn_on«-kald for at muliggøre øjeblikkelig farve- og lysstyrketilpasning. 🏎️ Slå fra for lyskilder, som ikke understøtter »light.turn_on« med farve og lysstyrke.",
"multi_light_intercept": "multi_light_intercept: Indfang og tilpas »light.turn_on«-kald til mere end en enkelt lyskilde. ➗⚠️ Dette kan bevirke at et enkelt »light.turn_on«-kald deles op i flere, f.eks. hvis lyskilderne er forbundet til forskellige kontakter. Forudsætter at »intercept« er slået til."
},
"data_description": {
"interval": "Frekvens til at tilpasse lysene, i sekunder. 🔄",
@ -59,7 +63,12 @@
"sunrise_offset": "Juster solopgangstiden med en positiv eller negativ offset på få sekunder. ⏰",
"max_sunset_time": "Indstil den seneste virtuelle solnedgangstid (HH:MM:SS), hvilket giver mulighed for tidligere solnedgange. 🌇",
"sleep_color_temp": "Farvetemperatur i søvntilstand (bruges når `sleep_rgb_or_color_temp` er `color_temp`) i Kelvin. 😴",
"brightness_mode": "Lysstyrketilstand til brug. Mulige værdier er \"default\", \"linear\" og \"tanh\" (bruger \"brightness_mode_time_dark\" og \"brightness_mode_time_light\"). 📈"
"brightness_mode": "Lysstyrketilstand til brug. Mulige værdier er \"default\", \"linear\" og \"tanh\" (bruger \"brightness_mode_time_dark\" og \"brightness_mode_time_light\"). 📈",
"send_split_delay": "Forsinkelse (ms) mellem »separate_turn_on_commands« for lyskilder som ikke understøtter simultane styrke- og farveindstillinger. ⏲️",
"initial_transition": "Den første overgangs varighed når lysene ændres fra »off« til »on« i sekunder. ⏲️",
"sleep_rgb_color": "RGB-farve i søvntilstand (anvendes når »sleep_rgb_or_color_temp« er sat til »rgb_color«). 🌈",
"brightness_mode_time_dark": "(Ignoreres hvis »brightness_mode='default'«) Varigheden i sekunder for tilpasningen af lysstyrken ved solopgang eller -nedgang. 📈📉",
"brightness_mode_time_light": "(Ignoreres hvis »brightness_mode='default'«) Varigheden i sekunder for tilpasningen af lysstyrken ved solopgang eller -nedgang. 📈📉"
}
}
},
@ -153,12 +162,26 @@
},
"sleep_color_temp": {
"description": "Farvetemperatur i søvntilstand (bruges når `sleep_rgb_or_color_temp` er `color_temp`) i Kelvin. 😴"
},
"send_split_delay": {
"description": "Forsinkelse (ms) mellem »separate_turn_on_commands« for lyskilder som ikke understøtter simultane styrke- og farveindstillinger. ⏲️"
},
"detect_non_ha_changes": {
"description": "Opdager og stopper tilpasningen ved tilstandsændringer, som ikke er udløst af »light.turn_on«. Indstillingen »take_over_control« skal være aktiveret. 🕵️ Advarsel: ⚠️ Nogle lyskilder kan rapportere en falsk tændt-tilstand, hvilket kan medføre af lyskilden tændes når det ikke er meningen. Slå denne funktion fra, hvis du oplever dette problem."
},
"initial_transition": {
"description": "Den første overgangs varighed når lysene ændres fra »off« til »on« i sekunder. ⏲️"
}
},
"description": "Skift de indstillinger du ønsker i kontakten. Alle muligheder her er de samme som i konfigurationsflowet."
},
"set_manual_control": {
"description": "Markér om et lys er 'manuelt kontrolleret'."
"description": "Markér om et lys er 'manuelt kontrolleret'.",
"fields": {
"lights": {
"description": "entity_id(er) af lys, hvis ikke specificeret, vil alle lys i kontakten være valgt. 💡"
}
}
}
}
}

View file

@ -8,6 +8,13 @@
"data": {
"name": "Name"
}
},
"menu": {
"title": "Erstellen oder Duplizieren",
"description": "Möchtest du eine neue Instanz erstellen oder eine existierende duplizieren?",
"data": {
"action": "Aktion"
}
}
},
"abort": {
@ -18,7 +25,7 @@
"step": {
"init": {
"title": "Optionen für Adaptive Beleuchtung",
"description": "Alle Einstellungen für eine Adaptive Lighting Komponente. Die Optionsnamen entsprechen den YAML-Einstellungen. Es werden keine Optionen angezeigt, wenn dieser Eintrag in YAML konfiguriert wurde. Interaktive Diagramme zur Veranschaulichung der Auswirkungen der Parameter finden Sie unter [dieser Webanwendung](https://basnijholt.github.io/adaptive-lighting). Weitere Details finden Sie in der [offiziellen Dokumentation](https://github.com/basnijholt/adaptive-lighting#readme).",
"description": "Alle Einstellungen für eine Adaptive Lighting Komponente. Die Optionsnamen entsprechen den YAML-Einstellungen. Es werden keine Optionen angezeigt, wenn dieser Eintrag in YAML konfiguriert wurde. Interaktive Diagramme zur Veranschaulichung der Auswirkungen der Parameter finden Sie unter [dieser Webanwendung]({webapp_url}). Weitere Details finden Sie in der [offiziellen Dokumentation]({docs_url}).",
"data": {
"lights": "Lichter",
"initial_transition": "initial_transition, wenn Lichter von 'off' zu 'on' wechseln oder wenn 'sleep_state' wechselt",
@ -47,7 +54,7 @@
"transition": "transition, Wechselzeit in Sekunden",
"adapt_delay": "adapt_delay: Wartezeit (in Sekunden) zwischen Anschalten des Licht und der Anpassung durch Adaptive Lights. Kann Flackern vermeiden.",
"skip_redundant_commands": "skip_redundant_commands: Überspringt das Senden von Anpassungsbefehlen, deren Zielzustand bereits mit dem bekannten Zustand der Leuchte übereinstimmt. Minimiert den Netzwerkverkehr und verbessert die Anpassungsreaktion in einigen Situationen. 📉 Deaktivieren, falls der physikalische Zustand der Lichter nicht mehr mit dem Zustand in HA übereinstimmt.",
"adapt_only_on_bare_turn_on": "adapt_only_on_bare_turn_on: Beim ersten Einschalten des Lichts. Wenn auf `true` gesetzt, passt AL das Licht nur an, wenn `light.turn_on` ohne eine Angabe von Farbe oder Helligkeit aufgerufen wird. ❌🌈 Dies verhindert z.B. die Anpassung durch AL beim Aktivieren einer Szene. Wenn auf \"false\" gesetzt, passt AL das licht unabhängig von der Angabe von Farbe oder Helligkeit in den ursprünglichen `service_data` an. Benötigt das `take_over_control` aktiviert ist. 🕵️ ",
"adapt_only_on_bare_turn_on": "adapt_only_on_bare_turn_on: Beim ersten Einschalten des Lichts. Wenn auf `true` gesetzt, passt AL das Licht nur an, wenn `light.turn_on` ohne eine Angabe von Farbe oder Helligkeit aufgerufen wird. ❌🌈 Dies verhindert z.B. die Anpassung durch AL beim Aktivieren einer Szene. Wenn auf \"false\" gesetzt, passt AL das licht unabhängig von der Angabe von Farbe oder Helligkeit in den ursprünglichen `service_data` an. Benötigt das `take_over_control` aktiviert ist. 🕵️",
"include_config_in_attributes": "include_config_in_attributes: Alle Optionen als Attribute auf dem Schalter im Home Assistant anzeigen, wenn auf `true` gesetzt. 📝",
"multi_light_intercept": "multi_light_intercept: Abfangen und Anpassen von `light.turn_on`-Aufrufen, die auf mehrere Lichter aufrufen. ➗⚠️ Dies kann dazu führen, dass ein einzelner `light.turn_on`-Aufruf in mehrere Aufrufe aufgeteilt wird, z.B. wenn Lichter in verschiedenen Schaltern sind. Erfordert, dass `intercept` aktiviert ist.",
"transition_until_sleep": "transition_until_sleep: Wenn diese Option aktiviert ist, behandelt die adaptive Beleuchtung die Schlafeinstellungen als Minimum und geht nach Sonnenuntergang zu diesen Werten über. 🌙",

View file

@ -0,0 +1,19 @@
{
"title": "Adaptive Lighting",
"options": {
"step": {
"init": {
"title": "Επιλογές Adaptive Lighting"
}
}
},
"services": {
"change_switch_settings": {
"fields": {
"only_once": {
"description": "Προσαρμογή των φώτων μόνο όταν είναι αναμμένα (`true`) ή συνεχής προσαρμογή αυτών (`false`). 🔄"
}
}
}
}
}

View file

@ -8,6 +8,13 @@
"data": {
"name": "Name"
}
},
"menu": {
"title": "Create or Duplicate",
"description": "Do you want to create a new instance or duplicate an existing one?",
"data": {
"action": "Action"
}
}
},
"abort": {
@ -18,7 +25,7 @@
"step": {
"init": {
"title": "Adaptive Lighting options",
"description": "Configure an Adaptive Lighting component. Option names align with the YAML settings. If you've defined this entry in YAML, no options will appear here. For interactive graphs that demonstrate parameter effects, visit [this web app](https://basnijholt.github.io/adaptive-lighting). For further details, see the [official documentation](https://github.com/basnijholt/adaptive-lighting#readme).",
"description": "Configure an Adaptive Lighting component. Option names align with the YAML settings. If you've defined this entry in YAML, no options will appear here. For interactive graphs that demonstrate parameter effects, visit [this web app]({webapp_url}). For further details, see the [official documentation]({docs_url}).",
"data": {
"lights": "lights: List of light entity_ids to be controlled (may be empty). 🌟",
"interval": "interval",
@ -46,11 +53,12 @@
"brightness_mode": "brightness_mode",
"brightness_mode_time_dark": "brightness_mode_time_dark",
"brightness_mode_time_light": "brightness_mode_time_light",
"take_over_control": "take_over_control: Disable Adaptive Lighting if another source calls `light.turn_on` while lights are on and being adapted. Note that this calls `homeassistant.update_entity` every `interval`! 🔒",
"detect_non_ha_changes": "detect_non_ha_changes: Detects and halts adaptations for non-`light.turn_on` state changes. Needs `take_over_control` enabled. 🕵️ Caution: ⚠️ Some lights might falsely indicate an 'on' state, which could result in lights turning on unexpectedly. Disable this feature if you encounter such issues.",
"take_over_control": "take_over_control: Pause adaptation of individual lights and hand over (manual) control to other sources that issue `light.turn_on` calls for lights that are on. 🔒",
"take_over_control_mode": "take_over_control_mode",
"detect_non_ha_changes": "detect_non_ha_changes: Detects and halts adaptations for non-`light.turn_on` state changes. Needs `take_over_control` enabled. 🕵️ Caution: ⚠️ Some lights might falsely indicate an 'on' state, which could result in lights turning on unexpectedly. Note that this calls `homeassistant.update_entity` every `interval`! Disable this feature if you encounter such issues.",
"autoreset_control_seconds": "autoreset_control_seconds",
"only_once": "only_once: Adapt lights only when they are turned on (`true`) or keep adapting them (`false`). 🔄",
"adapt_only_on_bare_turn_on": "adapt_only_on_bare_turn_on: When turning lights on initially. If set to `true`, AL adapts only if `light.turn_on` is invoked without specifying color or brightness. ❌🌈 This e.g., prevents adaptation when activating a scene. If `false`, AL adapts regardless of the presence of color or brightness in the initial `service_data`. Needs `take_over_control` enabled. 🕵️ ",
"adapt_only_on_bare_turn_on": "adapt_only_on_bare_turn_on: When turning lights on initially. If set to `true`, AL adapts only if `light.turn_on` is invoked without specifying color or brightness. ❌🌈 This e.g., prevents adaptation when activating a scene and marks the light as manually controlled. If `false`, AL adapts regardless of the presence of color or brightness in the initial `service_data`. Needs `take_over_control` enabled. 🕵️",
"separate_turn_on_commands": "separate_turn_on_commands: Use separate `light.turn_on` calls for color and brightness, needed for some light types. 🔀",
"send_split_delay": "send_split_delay",
"adapt_delay": "adapt_delay",
@ -79,6 +87,7 @@
"brightness_mode": "Brightness mode to use. Possible values are `default`, `linear`, and `tanh` (uses `brightness_mode_time_dark` and `brightness_mode_time_light`). 📈",
"brightness_mode_time_dark": "(Ignored if `brightness_mode='default'`) The duration in seconds to ramp up/down the brightness before/after sunrise/sunset. 📈📉",
"brightness_mode_time_light": "(Ignored if `brightness_mode='default'`) The duration in seconds to ramp up/down the brightness after/before sunrise/sunset. 📈📉.",
"take_over_control_mode": "The adaptation pausing mode when other sources change brightness and/or color of lights. `pause_all` always pauses both brightness and color adaptation. `pause_changed` pauses the adaptation of only the changed attributes and continues adapting unchanged attributes, e.g., continues color adaptation when only brightness was changed.",
"autoreset_control_seconds": "Automatically reset the manual control after a number of seconds. Set to 0 to disable. ⏲️",
"send_split_delay": "Delay (ms) between `separate_turn_on_commands` for lights that don't support simultaneous brightness and color setting. ⏲️",
"adapt_delay": "Wait time (seconds) between light turn on and Adaptive Lighting applying changes. Might help to avoid flickering. ⏲️"
@ -138,7 +147,7 @@
"name": "lights"
},
"manual_control": {
"description": "Whether to add (\"true\") or remove (\"false\") the light from the \"manual_control\" list. 🔒",
"description": "Whether to add (\"true\") or remove (\"false\") all adapted attributes of the light from the \"manual_control\" list, or the name of an attribute for selective addition. 🔒",
"name": "manual_control"
}
}
@ -244,11 +253,15 @@
"name": "min_sunset_time"
},
"take_over_control": {
"description": "Disable Adaptive Lighting if another source calls `light.turn_on` while lights are on and being adapted. Note that this calls `homeassistant.update_entity` every `interval`! 🔒",
"description": "Pause adaptation of individual lights and hand over (manual) control to other sources that issue `light.turn_on` calls for lights that are on. 🔒",
"name": "take_over_control"
},
"take_over_control_mode": {
"description": "The adaptation pausing mode when other sources change brightness and/or color of lights. `pause_all` always pauses both brightness and color adaptation. `pause_changed` pauses the adaptation of only the changed attributes and continues adapting unchanged attributes, e.g., continues color adaptation when only brightness was changed.",
"name": "take_over_control_mode"
},
"detect_non_ha_changes": {
"description": "Detects and halts adaptations for non-`light.turn_on` state changes. Needs `take_over_control` enabled. 🕵️ Caution: ⚠️ Some lights might falsely indicate an 'on' state, which could result in lights turning on unexpectedly. Disable this feature if you encounter such issues.",
"description": "Detects and halts adaptations for non-`light.turn_on` state changes. Needs `take_over_control` enabled. 🕵️ Caution: ⚠️ Some lights might falsely indicate an 'on' state, which could result in lights turning on unexpectedly. Note that this calls `homeassistant.update_entity` every `interval`! Disable this feature if you encounter such issues.",
"name": "detect_non_ha_changes"
},
"transition": {

View file

@ -29,7 +29,7 @@
"adapt_delay": "Tiempo de espera (segundos) entre el encendido de la luz y Adaptive Lighting aplicando cambios. Puede ayudar a evitar parpadeos. ⏲️"
},
"data": {
"adapt_only_on_bare_turn_on": "adapt_only_on_bare_turn_on: Al encender las luces. Si el valor es `true`, AL adapta sólo si se llama `light.turn_on` sin especificar el color o brillo. ❌🌈 Esto, por ejemplo, previene la adaptación al activar una escena. Si el valor es `false`, AL adapta independientemente de la presencia de color o brillo en `service_data` inicial. Necesita `take_over_control` habilitado. 🕵️ ",
"adapt_only_on_bare_turn_on": "adapt_only_on_bare_turn_on: Al encender las luces. Si el valor es `true`, AL adapta sólo si se llama `light.turn_on` sin especificar el color o brillo. ❌🌈 Esto, por ejemplo, previene la adaptación al activar una escena. Si el valor es `false`, AL adapta independientemente de la presencia de color o brillo en `service_data` inicial. Necesita `take_over_control` habilitado. 🕵️",
"detect_non_ha_changes": "detect_non_ha_changes: Detecta e interrumpe adaptaciones para cambios de estado no `light.turn_on`. Necesita `take_over_control` habilitado. 🕵️ Precaución: ⚠️ Algunas luces pueden indicar de forma errónea un estado 'on', que puede resultar en luces que se enciendan de forma no esperada. Deshabilita esta función si encuentras dichos problemas.",
"intercept": "intercept: Intercepta y adapta llamadas a `light.turn_on` para habilitar adaptaciones instantáneas de color y brillo. 🏎️ Deshabilitar para luces que no soporten `light.turn_on` con color y brillo.",
"min_color_temp": "min_color_temp: Temperatura de color más cálida en grados Kelvin. 🔥",
@ -46,7 +46,7 @@
"skip_redundant_commands": "skip_redundant_commands: Evitar mandar comandos de adaptación a luces cuyo estado ya sea el esperado. Reduce tráfico en la red y mejora la respuesta de la adaptación en ciertas situaciones. 📉Deshabilitar si el estado real de las luces se desincroniza con el estado registrado en Home Assistant.",
"take_over_control": "take_over_control: Deshabilita Adaptive Lighting si otra fuente llama`light.turn_on` mientras las luces están encendidas y adaptándose. Cuidado, esto llama`homeassistant.update_entity` cada `interval`! 🔒"
},
"description": "Configura un componente Adaptive Lighting. Los nombres de las opciones se asemejan a las disponibles en la configuración YAML. Si has definido esta entrada en YAML, no aparecerá ninguna opción aquí. Para gráficos interactivos que demuestran los efectos de los parámetros, visita [esta web app](https://basnijholt.github.io/adaptive-lighting). Para más detalles, ver la [documentación oficial](https://github.com/basnijholt/adaptive-lighting#readme)."
"description": "Configura un componente Adaptive Lighting. Los nombres de las opciones se asemejan a las disponibles en la configuración YAML. Si has definido esta entrada en YAML, no aparecerá ninguna opción aquí. Para gráficos interactivos que demuestran los efectos de los parámetros, visita [esta web app]({webapp_url}). Para más detalles, ver la [documentación oficial]({docs_url})."
}
},
"error": {

View file

@ -28,8 +28,69 @@
},
"transition": {
"description": "Valojen siirtymän kesto sekunneissa, kun valaistusta muutetaan."
},
"sleep_color_temp": {
"description": "Värilämpötila lepotilassa (käytetään, kun `sleep_rgb_or_color_temp` on `color_temp`) kelvineinä. 😴"
},
"detect_non_ha_changes": {
"description": "Havaitsee ja pysäyttää mukautukset ei-\"light.turn_on\" -tilanmuutoksille. Vaatii \"take_over_control\":n käyttöönoton. 🕵️ Varoitus: ⚠️ Jotkut valot saatavat osoittaa virheellisesti 'on'-tilan, mikä voi johtaa valojen syttymiseen odottamatta. Poista tämä ominaisuus käytöstä, jos kohtaat tällaisia ongelmia."
},
"sunrise_time": {
"description": "Aseta kiinteä aika (TT:MM:SS) auringonnousulle. 🌅"
},
"use_defaults": {
"description": "Asettaa oletusarvot, joita ei ole määritetty tässä palvelukutsussa. Vaihtoehdot: \"nykyinen\" (oletus, säilyttää nykyiset arvot), \"tehdas\" (palauttaa dokumentoituihin oletusasetuksiin) tai \"kokoonpano\" (palaa kokoonpanon oletusasetusten vaihtamiseksi). ⚙️"
},
"max_sunrise_time": {
"description": "Aseta viimeisin virtuaalinen auringonnousuaika (TT:MM:SS), aikaisempia auringonnousuja sallien. 🌅"
},
"separate_turn_on_commands": {
"description": "Käytä erillisiä \"light.turn_on\" -kutsuja värin ja kirkkauden määrittämiseksi, joita tarvitaan joissakin valotyypeissä. 🔀"
},
"entity_id": {
"description": "Kytkimen entiteettitunnus. 📝"
},
"turn_on_lights": {
"description": "Sytytetäänkö valot, jotka ovat tällä hetkellä pois päältä. 🔆"
},
"include_config_in_attributes": {
"description": "Näytä kaikki vaihtoehdot attribuutteina kotiavustajan kytkimellä, kun sen arvo on \"true\". 📝"
},
"sleep_transition": {
"description": "Siirtymän kesto, kun \"lepotila\" vaihdetaan sekunneiksi. 😴"
},
"max_brightness": {
"description": "Enimmäiskirkkausprosentti. 💡"
},
"min_brightness": {
"description": "Vähittäiskirkkausprosentti. 💡"
},
"sleep_rgb_color": {
"description": "RGB-väri lepotilassa (käytetään, kun `sleep_rgb_or_color_temp` on \"rgb_color\"). 🌈"
},
"sunset_time": {
"description": "Aseta kiinteä aika (TT:MM:SS) auringonlaskulle. 🌇"
},
"sleep_rgb_or_color_temp": {
"description": "Käytä joko `\"rgb_color\"` tai `\"color_temp\"` lepotilassa. 🌙"
},
"min_color_temp": {
"description": "Lämpimin värilämpötila kelvineissä. 🔥"
},
"prefer_rgb_color": {
"description": "Halutaanko RGB-värinsäätö mieluummin valon värilämpötilan sijaan, kun mahdollista. 🌈"
},
"take_over_control": {
"description": "Poista Adaptive Lighting käytöstä, jos toinen lähde kutsuu `light.turn_on`, kun valot ovat päällä ja niitä mukautetaan. Huomaa, että tämä kutsuu `homeassistant.update_entity` joka `interval`! 🔒"
},
"min_sunset_time": {
"description": "Aseta aikaisin virtuaalinen auringonlaskuaika (TT:MM:SS), myöhempiä auringonlaskuja sallien. 🌇"
},
"adapt_delay": {
"description": "Odotusaika (sekunteina) valon syttymisen ja Adaptive Lightingin muutosten käyttöönoton välillä. Saattaa auttaa välttämään välkkymistä. ⏲️"
}
}
},
"description": "Muuta haluamiasi asetuksia kytkimessä. Kaikki vaihtoehdot ovat samat kuin kokoonpanon kulussa."
},
"apply": {
"description": "Asettaa nykyiset Adaptiivisen Valaistuksen asetukset valoihin.",
@ -39,8 +100,37 @@
},
"transition": {
"description": "Valojen siirtymän kesto sekunneissa, kun valaistusta muutetaan."
},
"entity_id": {
"description": "Kytkimen `entity_id` ja käytettävät asetukset. 📝"
},
"adapt_brightness": {
"description": "Mukautetaanko valon kirkkautta. 🌞"
},
"adapt_color": {
"description": "Mukautetaanko tukivalojen väriä. 🌈"
},
"prefer_rgb_color": {
"description": "Halutaanko RGB-värinsäätö mieluummin valon värilämpötilan sijaan, kun mahdollista. 🌈"
},
"turn_on_lights": {
"description": "Sytytetäänkö valot, jotka ovat tällä hetkellä pois päältä. 🔆"
}
}
},
"set_manual_control": {
"fields": {
"lights": {
"description": "Valojen entity_id(s), jos sitä ei ole määritetty, kaikki kytkimen valot valitaan. 💡"
},
"entity_id": {
"description": "Kytkimen `entity_id`, jolla valo määritetään `manuaalisesti ohjattavaksi`. 📝"
},
"manual_control": {
"description": "Lisätäänkö (\"true\") vai poistetaanko (\"false\") valo \"manual_control\"-luettelosta. 🔒"
}
},
"description": "Merkitse, onko valo 'manuaalisesti ohjattu'."
}
},
"title": "Adaptiivinen valaistus",
@ -55,16 +145,58 @@
"brightness_mode": "Kirkkaus-moodi jota käytetään. Mahdolliset arvot ovat `default`, `linear`, and `tanh` (käyttää arvoja `brightness_mode_time_dark` ja `brightness_mode_time_light`).",
"sunset_offset": "Muuta auringonlaskun aikaa positiivisella tai negatiivisella korjauksella määritettynä sekunneissa.",
"initial_transition": "Ensimmäisen siirtymän kesto sekunneissa, kun valot kytketään 'off'-tilasta 'on'-tilaan.",
"send_split_delay": "Viive (ms) `separate_turn_on_commands` välillä valoille, jotka eivät tue yhtäaikaista kirkkauden ja värilämpötilan säätöä."
}
"send_split_delay": "Viive (ms) `separate_turn_on_commands` välillä valoille, jotka eivät tue yhtäaikaista kirkkauden ja värilämpötilan säätöä.",
"sleep_color_temp": "Värilämpötila lepotilassa (käytetään, kun `sleep_rgb_or_color_temp` on `color_temp`) kelvineinä. 😴",
"brightness_mode_time_dark": "(Ohitetaan, jos `brightness_mode='default'`) Kesto sekunteina kirkkauden lisäämiseen/vähentämiseen auringonnousun/auringonlaskun jälkeen/ennen. 📈📉.",
"adapt_delay": "Odotusaika (sekunteina) valon syttymisen ja Adaptive Lightingin muutosten käyttöönoton välillä. Saattaa auttaa välttämään välkkymistä. ⏲️",
"sleep_transition": "Siirtymän kesto, kun \"lepotila\" vaihdetaan sekunneiksi. 😴",
"interval": "Tiheys valojen mukauttamiseen sekunneissa. 🔄",
"brightness_mode_time_light": "(Ohitetaan, jos `brightness_mode='default'`) Kesto sekunteina kirkkauden lisäämiseen/vähentämiseen auringonnousun/auringonlaskun jälkeen/ennen. 📈📉.",
"sleep_rgb_color": "RGB-väri lepotilassa (käytetään, kun `sleep_rgb_or_color_temp` on \"rgb_color\"). 🌈",
"sunrise_time": "Aseta kiinteä aika (TT:MM:SS) auringonnousulle. 🌅",
"sunset_time": "Aseta kiinteä aika (TT:MM:SS) auringonlaskulle. 🌇",
"min_sunset_time": "Aseta aikaisin virtuaalinen auringonlaskuaika (TT:MM:SS), myöhempiä auringonlaskuja sallien. 🌅",
"min_sunrise_time": "Aseta aikaisin virtuaalinen auringonnousuaika (TT:MM:SS), myöhempiä auringonnousuja sallien. 🌅",
"max_sunrise_time": "Aseta aikaisin virtuaalinen auringonnousuaika (TT:MM:SS), aikaisempia auringonnousuja sallien. 🌅",
"sleep_rgb_or_color_temp": "Käytä joko `\"rgb_color\"` tai `\"color_temp\"` lepotilassa. 🌙",
"max_sunset_time": "Aseta viimeisin virtuaalinen auringonlaskuaika (TT:MM:SS), jotta aikaisemmat auringonlaskut ovat mahdollisia. 🌇"
},
"description": "Määritä Adaptive Lighting -komponentti. Vaihtoehtojen nimet vastaavat YAML-asetuksia. Jos olet määrittänyt tämän merkinnän YAML:ssa, tässä ei näy vaihtoehtoja. Interaktiiviset kaaviot, jotka esittelevät parametrien vaikutuksia, on [tässä verkkosovelluksessa]({webapp_url}). Lisätietoja löytyy [virallisesta dokumentaatiosta]({docs_url}).",
"data": {
"adapt_only_on_bare_turn_on": "adapt_only_on_bare_turn_on: Kun valot sytytetään ensimmäisen kerran. Jos asetuksena on \"true\", Adaptive Lighting mukautuu vain, jos \"light.turn_on\" kutsutaan määrittelemättä väriä tai kirkkautta. ❌🌈 Tämä esimerkiksi estää mukautumisen näkymää aktivoitaessa. Jos \"false\", Adaptive Lighting mukautuu riippumatta siitä, onko alkuperäisessä \"service_data\"-arvossa väri tai kirkkaus. Vaatii \"take_over_control\":n käyttöönoton. 🕵️",
"multi_light_intercept": "multi_light_intercept: sieppaa ja mukauta light.turn_on-kutsut, jotka kohdistuvat useisiin valoihin. ➗⚠️ Tämä saattaa johtaa yksittäisen light.turn_on-kutsun jakamiseen useiksi kutsuiksi, esimerkiksi kun valot ovat eri kytkimissä. Vaadi `intercept`:n käyttöönotto.",
"only_once": "only_once: Mukauta valot vain, kun ne ovat päällä (\"true\") tai mukauta niitä jatkuvasti (\"false\"). 🔄",
"skip_redundant_commands": "skip_redundant_commands: Ohita mukautuskomentojen lähettäminen, joiden kohdetila on jo yhtä suuri kuin valon tunnettu tila. Minimoi verkkoliikenteen ja parantaa mukautumisvastetta joissain tilanteissa. 📉 Poista käytöstä, jos fyysiset valotilat eivät ole synkronoitu kotiavustajan tallennetun tilan kanssa.",
"take_over_control": "take_over_control: Poista mukautuva valaistus käytöstä, jos toinen lähde kutsuu `light.turn_on`, kun valot ovat päällä ja niitä mukautetaan. Huomaa, että tämä kutsuu `homeassistant.update_entity` joka `interval`! 🔒",
"detect_non_ha_changes": "detect_non_ha_changes: Havaitsee ja pysäyttää mukautukset ei-\"light.turn_on\" -tilanmuutoksille. Vaatii \"take_over_control\" käyttöönoton. 🕵️ Varoitus: ⚠️ Jotkut valot saatavat osoittaa virheellisesti 'on'-tilan, mikä voi johtaa valojen syttymiseen odottamatta. Poista tämä ominaisuus käytöstä, jos kohtaat tällaisia ongelmia.",
"lights": "lights: Luettelo ohjattavista valon entity_ids:stä (voi olla tyhjä). 🌟",
"max_brightness": "max_brightness: Enimmäiskirkkausprosentti. 💡",
"max_color_temp": "max_color_temp: Kylmin värilämpötila kelvineinä. ❄️",
"min_brightness": "min_brightness: Vähittäiskirkkausprosentti. 💡",
"min_color_temp": "min_color_temp: Lämpimin värilämpötila kelvineinä. 🔥",
"prefer_rgb_color": "prefer_rgb_color: valitaanko RGB-värien säätö valon värilämpötilan sijaan, kun mahdollista. 🌈",
"transition_until_sleep": "shift_until_sleep: Kun käytössä, Adaptive Lighting käsittelee lepoasetukset miniminä ja siirtyy näihin arvoihin auringonlaskun jälkeen. 🌙",
"include_config_in_attributes": "include_config_in_attributes: Näytä kaikki vaihtoehdot attribuutteina Kotiavustajan kytkimessä, kun asetuksena on \"true\". 📝",
"intercept": "intercept: sieppaa ja mukauta \"light.turn_on\"-kutsut mahdollistamaan välitön värin ja kirkkauden mukauttaminen. 🏎️ Poista käytöstä valot, jotka eivät tue \"light.turn_on\" värin ja kirkkauden kanssa.",
"separate_turn_on_commands": "separate_turn_on_commands: Käytä erillisiä `light.turn_on`-kutsuja värin ja kirkkauden määrittämiseksi, joita tarvitaan joissakin valotyypeissä. 🔀"
},
"title": "Adaptive Lightingin vaihtoehdot"
}
},
"error": {
"option_error": "Virheellinen vaihtoehto",
"entity_missing": "Kotiavustajasta puuttuu yksi tai useampi valittu valoentiteetti"
}
},
"config": {
"step": {
"user": {
"title": "Valitse nimi tälle Adaptiivisen Valaistuksen esiintymälle"
"title": "Valitse nimi tälle Adaptiivisen Valaistuksen esiintymälle",
"description": "Jokainen esiintymä voi sisältää useita valoja!"
}
},
"abort": {
"already_configured": "Tämä laite on jo määritetty"
}
}
}

View file

@ -4,7 +4,7 @@
"step": {
"user": {
"title": "Choisissez un nom pour cette instance d'éclairage adaptatif",
"description": "Choisissez un nom pour cette instance. Vous pouvez configurer plusieurs instances d'éclairage adaptatif, chacune pouvant contrôler plusieurs lampes !",
"description": "Chaque instance peut contenir plusieurs lumières",
"data": {
"name": "Nom"
}
@ -18,71 +18,71 @@
"step": {
"init": {
"title": "Options d'éclairage adaptatif",
"description": "Tous les paramètres de l'instance d'éclairage adaptatif. Les noms des options correspondent aux paramètres YAML. Aucune option n'est affichée si l'entrée adaptive_lighting est définie dans votre configuration YAML.",
"description": "Configurer un composant d'éclairage adaptatif. Les noms correspondent aux paramètres YAML. Si vous avez défini cette entrée en YAML, aucune option n'apparaît ici. Pour les graphiques interactifs qui montrent les effets des paramètres, visiter [cette application web]({webapp_url}). Pour plus de détail, voir la [documentation]({docs_url})",
"data": {
"lights": "lights : Les lampes à contrôler",
"lights": "lights : Liste d'\"entity_ids\" de lumières à controller (peu être vide). 🌟",
"initial_transition": "initial_transition : Transition (en secondes) lorsque l'état d'une lampe passe d'« éteinte » à « allumée ».",
"sleep_transition": "sleep_transition : Transition (en secondes) lorsque « sleep_state » est commuté.",
"interval": "interval : Temps (en secondes) entre deux mises à jour du commutateur.",
"max_brightness": "max_brightness : Luminosité maximale des lampes (en pourcentage) au cours d'un cycle.",
"max_color_temp": "max_color_temp : Couleur la plus froide (en kelvins) du cycle de température de couleur.",
"min_brightness": "min_brightness : Luminosité minimale des lampes (en pourcentage) au cours d'un cycle.",
"min_color_temp": "min_color_temp : Couleur la plus chaude (en kelvins) du cycle de température de couleur.",
"only_once": "only_once : Adapter les lampes uniquement au moment où elles sont allumées.",
"prefer_rgb_color": "prefer_rgb_color : Utiliser « rgb_color » plutôt que « color_temp » lorsque cela est possible.",
"separate_turn_on_commands": "separate_turn_on_commands : Séparer les commandes pour chaque attribut (couleur, luminosité, etc.) de « light.turn_on » (nécessaire pour certaines lampes).",
"max_brightness": "max_brightness : Luminosité maximum (en pourcentage). 💡",
"max_color_temp": "max_color_temp : Couleur la plus froide (en Kelvins). ❄️",
"min_brightness": "min_brightness : Luminosité minimale en pourcentage. 💡",
"min_color_temp": "min_color_temp : Couleur de température la plus chaude en kelvins. 🔥",
"only_once": "only_once : Adapter les lampes uniquement au moment où elles sont allumées. 🔄",
"prefer_rgb_color": "prefer_rgb_color : Indique s'il est préférable d'utiliser le réglage de couleur RBG plutôt que la température de couleur lorsque cela est possible. 🌈",
"separate_turn_on_commands": "separate_turn_on_commands : Utiliser des appels \"light.turn_on\" séparés pour la couleur et la luminosité, nécessaires pour certains types de lumière. 🔀",
"sleep_brightness": "sleep_brightness : Luminosité (en pourcentage) du mode nuit.",
"sleep_color_temp": "sleep_color_temp : Température de couleur (en kelvins) du mode nuit.",
"sunrise_offset": "sunrise_offset : Décalage (en secondes [- : passé, + : futur]) du cycle par rapport au lever du soleil.",
"sunrise_time": "sunrise_time : Heure (HH:MM:SS) du lever du soleil. Si « None », utilise l'heure correspondant à votre emplacement.",
"sunset_offset": "sunset_offset : Décalage (en secondes [- : passé, + : futur]) du cycle par rapport au coucher du soleil.",
"sunset_time": "sunset_time : Heure (HH:MM:SS) du coucher du soleil. Si « None », utilise l'heure correspondant à votre emplacement.",
"take_over_control": "take_over_control : Si quelque chose d'autre que l'éclairage adaptatif appelle « light.turn_on » alors qu'une lampe est déjà allumée, cesser d'adapter cette lampe jusqu'à ce qu'elle (ou le commutateur) soit éteinte puis rallumée.",
"detect_non_ha_changes": "detect_non_ha_changes : Détecter tout changement de plus de 10 % appliqué aux lampes (même en dehors de HA). Nécessite que « take_over_control » soit activé. (Appelle « homeassistant.update_entity » tous les « interval » !)",
"take_over_control": "take_over_control : Désactive l'éclairage adaptatif si une autre source appelle \"light.turn_on\" pendant que la lumière est allumée ou adoptée. Notez que cela appelle \"homeassistant.update_entity\" chaque \"interval\"! 🔒",
"detect_non_ha_changes": "detect_non_ha_changes : Détecter et arrête les changement d'états autre que \"light.turn_on\". Nécessite que \"take_over_control\" soit activé. 🕵️ Attention : ⚠️ Certaines lumière peuvent faussement indiqué un état \"on\", ce qui pourrait occasionner des lumières s'allumant de façon inattendu. Désactivez cette fonctionnalité si vous rencontrez de tels problème.",
"transition": "transition : Durée de la transition (en secondes) des changements appliqués aux lampes.",
"adapt_only_on_bare_turn_on": "adapt_only_on_bare_turn_on: Quand on allume les lumières au départ. Si le paramètre est < < vrai > > , AL s ' adapte uniquement si l ' on invoque < < light.turn_on > > sans préciser la couleur ou la luminosité. ❌ Ceci, par exemple, empêche l'adaptation lors de l'activation d'une scène. Si `false`, AL s'adapte indépendamment de la présence de couleur ou de luminosité dans le `service_data' initial. Besoins `take_over_control` activé. 🕵∫ ",
"multi_light_intercept": "multi_light_intercept : Intercepte et adapte les appels à `light.turn_on` qui ciblent plusieurs lumières. ➗⚠️ Cela peut entraîner la division d'un seul appel `light.turn_on` en plusieurs appels, par exemple, lorsque les lumières sont dans différents interrupteurs. Nécessite que `intercept` soit activé.",
"intercept": "intercept : Intercepter et adapter les appels à `light.turn_on` pour permettre une adaptation instantanée de la couleur et de la luminosité. 🏎️ Désactivez cette option pour les lumières qui ne prennent pas en charge `light.turn_on` avec couleur et luminosité.",
"include_config_in_attributes": "include_config_in_attributes : Afficher toutes les options en tant qu'attributs sur l'interrupteur dans Home Assistant lorsqu'il est défini sur `true`. 📝",
"skip_redundant_commands": "skip_redundant_commands : Évite d'envoyer des commandes d'adaptation lorsque l'état cible est déjà égal à l'état connu de la lumière. Minimise le trafic réseau et améliore la réactivité de l'adaptation dans certaines situations. 📉 Désactivez si les états physiques des lumières ne correspondent pas à l'état enregistré de Home Assistant.",
"transition_until_sleep": "transition_until_sleep : Lorsqu'activée, l'Éclairage Adaptatif considérera les paramètres de sommeil comme le minimum, effectuant la transition vers ces valeurs après le coucher du soleil. 🌙"
"adapt_only_on_bare_turn_on": "adapt_only_on_bare_turn_on: Lors de l'allumage initiale des lumières. Si le paramètre est \"vrai\", AL s'adapte uniquement si l'on invoque \"light.turn_on\" sans préciser la couleur ou la luminosité. ❌🌈 Ceci, par exemple, empêche l'adaptation lors de l'activation d'une scène. Si \"false\", AL adapte indépendamment de la présence de couleur ou de luminosité dans le \"service_data\" initial. \"take_over_control\" doit être activé. 🕵",
"multi_light_intercept": "multi_light_intercept : Intercepte et adapte les appels à \"light.turn_on\" qui ciblent plusieurs lumières. ➗⚠️ Cela peut entraîner la division d'un seul appel \"light.turn_on\" en plusieurs appels, par exemple, lorsque les lumières sont dans différents interrupteurs. Nécessite que \"intercept\" soit activé.",
"intercept": "intercept : Intercepter et adapter les appels à \"light.turn_on\" pour permettre une adaptation instantanée de la couleur et de la luminosité. 🏎️ Désactivez cette option pour les lumières qui ne prennent pas en charge \"light.turn_on\" avec couleur et luminosité.",
"include_config_in_attributes": "include_config_in_attributes : Afficher toutes les options en tant qu'attributs sur l'interrupteur dans Home Assistant lorsqu'il est défini sur \"true\". 📝",
"skip_redundant_commands": "skip_redundant_commands : Évite d'envoyer des commandes d'adaptation lorsque l'état cible est déjà égal à l'état connu de la lumière. Minimise le trafic réseau et améliore la réactivité de l'adaptation dans certaines situations. 📉 Désactivez si les états physiques des lumières ne correspondent pas à l'état enregistré de Home Assistant.",
"transition_until_sleep": "transition_until_sleep : Lorsque cela est activée, l'éclairage Adaptatif considérera les paramètres du mode nuit comme le minimum, effectuant la transition vers ces valeurs après le coucher du soleil. 🌙"
},
"data_description": {
"interval": "Fréquence d'adaptation des lumières, en secondes. 🔄",
"sleep_brightness": "Pourcentage de luminosité des lumières en mode sommeil. 😴",
"autoreset_control_seconds": "Réinitialiser automatiquement la commande manuelle après un certain nombre de secondes. Définir à 0 pour désactiver. ⏲∫",
"sunset_offset": "Réglez le temps de coucher avec un décalage positif ou négatif en quelques secondes. ⏰",
"brightness_mode": "Mode de luminosité à utiliser. Les valeurs possibles sont < < par défaut > > , < < linéaire > > et < < parois > > , < < par défaut > > , et < < par coup > > , < < par défaut > > et par > par > . 📈",
"send_split_delay": "Délai (ms) entre \"separate_turn_on_commands\" pour les lumières qui ne supportent pas la commande de luminosité et le réglage de couleur en même temps. ⏲",
"sleep_color_temp": "Température de couleur en mode sommeil (utilisée lorsque `sleep_rgb_or_color_temp` est `color_temp`) en Kelvin. 😴",
"sleep_brightness": "Pourcentage de luminosité des lumières en mode nuit. 😴",
"autoreset_control_seconds": "Réinitialiser automatiquement la commande manuelle après un certain nombre de secondes. Définir à 0 pour désactiver. ⏲️",
"sunset_offset": "Réglez le l'heure de coucher du soleil avec un décalage positif ou négatif en quelques secondes. ⏰",
"brightness_mode": "Mode de luminosité à utiliser. Les valeurs possibles sont \"défaut\" , \"linear\" (linéaire) et \"tanh\" (tangente) utilise \"brightness_mode_time_dark\" et \"brightness_mode_time_light\". 📈",
"send_split_delay": "Délai (ms) entre \"separate_turn_on_commands\" pour les lumières qui ne supportent pas la commande de luminosité et le réglage de couleur en même temps. ⏲️",
"sleep_color_temp": "Température de couleur en mode nuit en Kelvin (utilisée lorsque \"sleep_rgb_or_color_temp\" est égaler à \"color_temp\") . 😴",
"sunrise_offset": "Ajuster l'heure du lever de soleil avec un décalage positif ou négatif en secondes. ⏰",
"transition": "Durée de la transition des changements lumineux, en secondes. 🕑",
"initial_transition": "Durée de la première transition des lampes passant de `off` à `on` en secondes. ⏲️",
"sleep_transition": "Durée de la transition quand le \"mode sommeil\" est déclenché en secondes. 😴",
"min_sunset_time": "Définir l'heure virtuelle de coucher du soleil la plus précoce (HH:MM:SS), permettant des couchers de soleil ultérieurs. 🌇",
"sleep_rgb_color": "Couleur RGB en mode sommeil (utilisée lorsque `sleep_rgb_or_color_temp` est `rgb_color`). 🌈",
"brightness_mode_time_light": "(Ignoré si `brightness_mode='default'`) La durée en secondes pour augmenter/diminuer progressivement la luminosité après/avant le lever/coucher du soleil. 📈📉.",
"sunset_time": "Définir une heure fixe (HH:MM:SS) pour le coucher du soleil. 🌅",
"initial_transition": "Durée de la première transition des lampes passent de \"off\" à \"on\" (en secondes). ⏲️",
"sleep_transition": "Durée de la transition quand le \"mode nuit\" est déclenché. (en secondes) 😴",
"min_sunset_time": "Définir l'heure virtuelle de coucher du soleil la plus précoce (HH:MM:SS), permettant des couchers de soleil tardifs. 🌇",
"sleep_rgb_color": "Couleur RGB en mode nuit (utilisée lorsque \"sleep_rgb_or_color_temp\" est \"rgb_color\"). 🌈",
"brightness_mode_time_light": "(Ignoré si \"brightness_mode='default'\") La durée en secondes pour augmenter/diminuer progressivement la luminosité après/avant le lever/coucher du soleil. 📈📉.",
"sunset_time": "Définir une heure fixe (HH:MM:SS) pour le coucher du soleil. 🌇",
"sunrise_time": "Définir une heure fixe (HH:MM:SS) pour le lever du soleil. 🌅",
"brightness_mode_time_dark": "(Ignoré si brightness_mode='default') La durée en secondes pour augmenter/diminuer progressivement la luminosité après/avant le lever/coucher du soleil. 📈📉.",
"sleep_rgb_or_color_temp": "Utilisez soit `\"rgb_color\"` soit `\"color_temp\"` en mode sommeil. 🌙",
"min_sunrise_time": "Définir l'heure virtuelle de lever du soleil la plus précoce (HH:MM:SS), permettant des levers de soleil ultérieurs. 🌅",
"brightness_mode_time_dark": "(Ignoré si \"brightness_mode='default'\") La durée en secondes pour augmenter/diminuer progressivement la luminosité après/avant le lever/coucher du soleil. 📈📉.",
"sleep_rgb_or_color_temp": "Utilisez soit \"rgb_color\" soit \"color_temp\" en mode nuit. 🌙",
"min_sunrise_time": "Définir l'heure virtuelle de lever du soleil la plus précoce (HH:MM:SS), permettant des levers de soleil tardifs. 🌅",
"adapt_delay": "Temps d'attente (en secondes) entre l'allumage de la lumière et l'application des changements par l'Éclairage Adaptatif. Peut aider à éviter les scintillements. ⏲️",
"max_sunset_time": "Définir l'heure virtuelle de coucher du soleil la plus tardive (HH:MM:SS), permettant des couchers de soleil plus précoces. 🌇",
"max_sunrise_time": "Définir l'heure virtuelle de lever du soleil la plus tardive (HH:MM:SS), permettant des levers de soleil plus précoces. 🌅"
"max_sunrise_time": "Définir l'heure virtuelle de lever du soleil la plus tardive (HH:MM:SS), permettant des levers de soleil plus tôt. 🌅"
}
}
},
"error": {
"option_error": "Option invalide",
"entity_missing": "Une lumière sélectionnée n’a pas été trouvée"
"entity_missing": "Une ou plusieurs entités lumières sélectionnées sont manquantes de Home Assistant"
}
},
"services": {
"change_switch_settings": {
"fields": {
"sleep_brightness": {
"description": "Pourcentage de luminosité des lumières en mode sommeil. 😴"
"description": "Pourcentage de luminosité des lumières en mode nuit. 😴"
},
"only_once": {
"description": "Adapter les lumières seulement quand elles sont allumées (\"vrai\") ou quel que soit leur état (\"faux\")."
@ -91,34 +91,34 @@
"description": "Ajustez l'heure de lever de soleil avec un décalage positif ou négatif en secondes. ⏰"
},
"max_color_temp": {
"description": "Température de couleur la plus froide en Kelvin. assemblage"
"description": "Température de couleur la plus froide en Kelvin. ❄️"
},
"send_split_delay": {
"description": "Délai (ms) entre \"separate_turn_on_commands\" pour les lumières qui ne supportent pas la commande de luminosité et le réglage de couleur en même temps. ⏲"
"description": "Délai (ms) entre \"separate_turn_on_commands\" pour les lumières qui ne supportent pas la commande de luminosité et le réglage de couleur en même temps. ⏲️"
},
"detect_non_ha_changes": {
"description": "Détecte et arrête les adaptations pour un changement d'état autre que \"light.turn_on\". Nécessite \"take_over_control\" activé. 🕵️ Attention: ⚠️Certaines lumières pourraient faussement indiquer un état \"on\", ce qui pourrait donner lieu à des allumages inattendus. Désactivez cette fonctionnalité si vous rencontrez ce problème."
"description": "detect_non_ha_changes : Détecter et arrête les changement d'états autre que \"light.turn_on\". Nécessite que \"take_over_control\" soit activé. 🕵️ Attention : ⚠️ Certaines lumière peuvent faussement indiqué un état \"on\", ce qui pourrait occasionner des lumières s'allumant de façon inattendu. Désactivez cette fonctionnalité si vous rencontrez de tels problème."
},
"autoreset_control_seconds": {
"description": "Réinitialiser automatiquement la commande manuelle après un certain nombre de secondes. Définir à 0 pour désactiver. ⏲∫"
"description": "Réinitialiser automatiquement la commande manuelle après un certain nombre de secondes. Définir à 0 pour désactiver. ⏲️"
},
"sunset_offset": {
"description": "Ajustez l'heure de coucher de soleil avec un décalage positif ou négatif en secondes. ⏰"
},
"sleep_color_temp": {
"description": "Température de couleur en mode sommeil (utilisé lorsque \"sleep_rgb_or_color_temp\" est défini sur \"color_temp\") en Kelvin. 😴"
"description": "Température de couleur en mode nuit en Kelvin (utilisé lorsque \"sleep_rgb_or_color_temp\" est défini sur \"color_temp\") . 😴"
},
"entity_id": {
"description": "ID de l'Entité de l'interrupteur. 📝"
},
"initial_transition": {
"description": "Durée de la première transition des lampes passant de `off` à `on` en secondes. ⏲️"
"description": "Durée de la première transition des lampes passant de \"off\" à \"on\" (en secondes). ⏲️"
},
"transition": {
"description": "Durée de la transition des changements lumineux, en secondes. 🕑"
},
"sleep_transition": {
"description": "Durée de la transition quand le \"mode sommeil\" est déclenché en secondes. 😴"
"description": "Durée de la transition quand le \"mode nuit\" est déclenché en secondes. 😴"
},
"min_brightness": {
"description": "Pourcentage de luminosité minimum. 💡"
@ -130,52 +130,52 @@
"description": "Pourcentage de luminosité maximale. 💡"
},
"take_over_control": {
"description": "Désactiver l'Éclairage Adaptatif si une autre source appelle `light.turn_on` lorsque les lumières sont allumées et en cours d'adaptation. Notez que cela appelle `homeassistant.update_entity` à chaque `intervalles` ! 🔒"
"description": "Désactiver l'Éclairage Adaptatif si une autre source appelle \"light.turn_on\" lorsque les lumières sont allumées et en cours d'adaptation. Notez que cela appelle \"homeassistant.update_entity\" à chaque \"intervalles\" ! 🔒"
},
"use_defaults": {
"description": "Définit les valeurs par défaut non spécifiées dans cet appel de service. Options : \"current\" (par défaut, conserve les valeurs actuelles), \"factory\" (réinitialise aux valeurs par défaut documentées) ou \"configuration\" (revient aux valeurs par défaut de la configuration de l'interrupteur). ⚙️"
"description": "Définit les valeurs par défaut non spécifiées dans cet appel de service. Options : \"current\" (par défaut, conserve les valeurs actuelles), \"factory\" (réinitialise aux valeurs par défaut documentées) ou \"configuration\" (revient aux valeurs par défaut de la configuration de l'interrupteur). ⚙️"
},
"sunset_time": {
"description": "Définir une heure fixe (HH:MM:SS) pour le coucher du soleil. 🌅"
"description": "Définir une heure fixe (HH:MM:SS) pour le coucher du soleil. 🌇"
},
"min_sunset_time": {
"description": "Définir l'heure virtuelle de coucher du soleil la plus précoce (HH:MM:SS), permettant des couchers de soleil ultérieurs. 🌇"
"description": "Définir l'heure virtuelle de coucher du soleil la plus précoce (HH:MM:SS), permettant des couchers de soleil tardifs. 🌇"
},
"max_sunrise_time": {
"description": "Définir l'heure virtuelle du lever du soleil la plus tardive (HH:MM:SS), permettant des levers de soleil plus précoces. 🌅"
"description": "Définir l'heure virtuelle du lever du soleil la plus tardive (HH:MM:SS), permettant des levers de soleil plus tôt. 🌅"
},
"min_color_temp": {
"description": "Température de couleur la plus chaude en Kelvin. 🔥"
},
"sleep_rgb_or_color_temp": {
"description": "Utilisez soit `\"rgb_color\"` soit `\"color_temp\"` en mode sommeil. 🌙"
"description": "Utilisez soit \"rgb_color\" soit \"color_temp\" en mode nuit. 🌙"
},
"turn_on_lights": {
"description": "Indique s'il faut allumer les lumières qui sont actuellement éteintes. 🔆"
},
"include_config_in_attributes": {
"description": "Afficher toutes les options en tant qu'attributs sur l'interrupteur dans Home Assistant lorsqu'il est défini sur `true`. 📝"
"description": "Afficher toutes les options en tant qu'attributs sur l'interrupteur dans Home Assistant lorsqu'il est défini sur \"true\". 📝"
},
"sleep_rgb_color": {
"description": "Couleur RGB en mode sommeil (utilisée lorsque `sleep_rgb_or_color_temp` est `rgb_color`). 🌈"
"description": "Couleur RGB en mode nuit (utilisée lorsque `sleep_rgb_or_color_temp` est `rgb_color`). 🌈"
},
"adapt_delay": {
"description": "Temps d'attente (en secondes) entre l'allumage de la lumière et l'application des changements par l'Éclairage Adaptatif. Peut aider à éviter les scintillements. ⏲️"
},
"separate_turn_on_commands": {
"description": "Utilisez des appels distincts à `light.turn_on` pour la couleur et la luminosité, nécessaire pour certains types de lumières. 🔀"
"description": "Utilisez des appels distincts à \"light.turn_on\" pour la couleur et la luminosité, nécessaire pour certains types de lumières. 🔀"
},
"prefer_rgb_color": {
"description": "Indique s'il faut privilégier l'ajustement de la couleur RGB plutôt que la température de couleur de la lumière lorsque c'est possible. 🌈"
}
},
"description": "Changez les réglages que vous souhaitez dans le commutateur. Toutes les options ici sont les mêmes que dans le flux de configuration."
"description": "Changez les réglages que vous souhaitez dans le commutateur. Toutes les options ici sont les mêmes que dans le flow de configuration."
},
"apply": {
"description": "Applique les réglages d'éclairage adaptatif actuels aux lumières.",
"fields": {
"lights": {
"description": "Une lumière (ou une liste de lumières) pour appliquer les réglages. personnalisation"
"description": "Une lumière (ou une liste de lumières) à laquelle appliquer les réglages."
},
"transition": {
"description": "Durée de la transition des changements lumineux, en secondes. 🕑"
@ -200,16 +200,16 @@
"set_manual_control": {
"fields": {
"lights": {
"description": "entity_id(s) des lumières, si non spécifié, toutes les lumières dans le commutateur sont sélectionnées. 💡"
"description": "entity_id(s) des lumières, si non spécifié, toutes les lumières de l'interrupteur sont sélectionnées. 💡"
},
"manual_control": {
"description": "Indique s'il faut ajouter (\"true\") ou retirer (\"false\") la lumière de la liste \"manual_control\". 🔒"
},
"entity_id": {
"description": "L'`entity_id` de l'interrupteur dans lequel (dé)marquer la lumière comme étant `manuellement contrôlée`. 📝"
"description": "L'\"entity_id\" de l'interrupteur dans lequel (dé)marquer la lumière comme étant \"manuellement contrôlée\". 📝"
}
},
"description": "Indiquer si une lumière est 'manuellement contrôlée'."
"description": "Indiquer si une lumière est \"contrôlée manuellement\"."
}
}
}

View file

@ -0,0 +1,45 @@
{
"options": {
"step": {
"init": {
"data_description": {
"sleep_brightness": "Porcentaxe de brillo das luces en modo durmir. 😴",
"send_split_delay": "Retraso (ms) entre `separate_turn_on_commands`",
"sunrise_offset": "Axusta a hora do amencer cun desfasamento positivo ou negativo en segundos. ⏰",
"sunset_offset": "Axusta a hora da posta de sol cun desfasamento positivo ou negativo en segundos. ⏰",
"interval": "Frecuencia para adaptar as luces, en segundos. 🔄"
},
"title": "Configuración de Iluminación Adaptativa"
}
}
},
"title": "Iluminación Adaptativa",
"services": {
"change_switch_settings": {
"fields": {
"sleep_brightness": {
"description": "Porcentaxe de brillo das luces en modo durmir. 😴"
},
"only_once": {
"description": "Adaptar luces só cando estean acesas (`true`) ou mantelas adaptándose (`false`). 🔄"
},
"sunrise_offset": {
"description": "Axusta a hora do amencer cun desfasamento positivo ou negativo en segundos. ⏰"
},
"sunset_offset": {
"description": "Axusta a hora da posta de sol cun desfasamento positivo ou negativo en segundos. ⏰"
},
"transition": {
"description": "Duración da transición cando as luces cambian, en segundos. 🕑"
}
}
}
},
"config": {
"step": {
"user": {
"title": "Escolle un nome para a instancia de Iluminación Dinámica"
}
}
}
}

View file

@ -2,7 +2,14 @@
"options": {
"step": {
"init": {
"title": "Opcije prilagodljivog osvjetljenja"
"title": "Opcije prilagodljivog osvjetljenja",
"data_description": {
"sunrise_offset": "Podesite vrijeme izlaska sunca s pozitivnim ili negativnim pomakom u sekundama. ⏰",
"sunset_offset": "Podesite vrijeme izlaska sunca s pozitivnim ili negativnim pomakom u sekundama. ⏰"
},
"data": {
"adapt_only_on_bare_turn_on": "adapt_only_on_bare_turn_on: Prilikom početnog paljenja svjetla. Ako je postavljeno na \"true\", AL se prilagođava samo ako se \"light.turn_on\" pozove bez navođenja boje ili svjetline. ❌🌈 Ovo npr. sprječava prilagodbu prilikom aktiviranja scene. Ako je \"false\", AL se prilagođava bez obzira na prisutnost boje ili svjetline u početnim \"service_data\". Potrebno je omogućiti `take_over_control`. 🕵️ "
}
}
}
},
@ -12,6 +19,12 @@
"fields": {
"only_once": {
"description": "Prilagodi svjetla samo kada su uključena (true) ili ih neprestano prilagođavaj (false). 🔄"
},
"sunrise_offset": {
"description": "Podesite vrijeme izlaska sunca s pozitivnim ili negativnim pomakom u sekundama. ⏰"
},
"sunset_offset": {
"description": "Podesite vrijeme izlaska sunca s pozitivnim ili negativnim pomakom u sekundama. ⏰"
}
}
}

View file

@ -30,7 +30,7 @@
"max_brightness": "max_brightness: Maximális fényerő százalékban megadva. 💡",
"detect_non_ha_changes": "detect_non_ha_changes: `Világítás: Bekapcsolás`- szolgáltatás meghívástól eltérő állapotváltozások esetén észleli és leállítja az illesztéseket. A `take_over_control` beállítás engedélyezése szükséges. 🕵️ Vigyázat: ⚠️ Egyes lights tévesen jelezhetik a \"bekapcsolt\" állapotot, ami váratlanul bekapcsolódó lámpákhoz vezethet. Ha ilyen problémákat tapasztal, tiltsa le ezt a funkciót.",
"multi_light_intercept": "multi_light_intercept: `Világítás: Bekapcsolás` szolgáltatás hívások elfogása és adaptálása, amelyek több fényt céloznak meg. ➗⚠️ Ez azt eredményezheti, hogy egyetlen `Világítás: Bekapcsolás` szolgáltatás hívás több hívásra oszlik fel, pl. ha a lights különböző kapcsolókban vannak. Az `elfogás` engedélyezése szükséges.",
"adapt_only_on_bare_turn_on": "adapt_only_on_bare_turn_on: Kizárólag a bekapcsoláskor érvényes. A beállítást \"igaz\"-ra állítva, az AL csak akkor végzi az illesztést, amennyiben a \"Világítás: Bekapcsolás\" szolgáltatás meghívása a szín és fényerő paraméterek megadása nélkül történik.❌🌈 Ez pl. alkalmas az illesztés felfüggesztésére egy jelenet aktiválásakor. \"Hamis\" beállítás esetén az AL elvégzi a kezdeti illesztést a szín és fényerő paraméterek meghívásától függetlenül. A használatához engedélyezve kell lennie a \"take_over_control\" beállításnak. 🕵️ ",
"adapt_only_on_bare_turn_on": "adapt_only_on_bare_turn_on: Kizárólag a bekapcsoláskor érvényes. A beállítást \"igaz\"-ra állítva, az AL csak akkor végzi az illesztést, amennyiben a \"Világítás: Bekapcsolás\" szolgáltatás meghívása a szín és fényerő paraméterek megadása nélkül történik.❌🌈 Ez pl. alkalmas az illesztés felfüggesztésére egy jelenet aktiválásakor. \"Hamis\" beállítás esetén az AL elvégzi a kezdeti illesztést a szín és fényerő paraméterek meghívásától függetlenül. A használatához engedélyezve kell lennie a \"take_over_control\" beállításnak. 🕵️",
"skip_redundant_commands": "skip_redundant_commands: Az olyan adaptációs parancsok küldésének kihagyása, amelyek célállapota már megegyezik a fény ismert állapotával. Minimalizálja a hálózati forgalmat, és bizonyos helyzetekben javítja az adaptációs reakciókészséget. 📉Kapcsolja ki, ha a fizikai fényállapotok nem szinkronizálódnak a HA rögzített állapotával.",
"separate_turn_on_commands": "separate_turn_on_commands: Elkülönített `Világítás: Bekapcsolás` hívásokat használ a szín és a fényerő beállításához, ami néhány világítás típusnál szükséges. 🔀",
"max_color_temp": "max_color_temp: A leghidegebb színhőmérséklet kelvinben. ❄️",
@ -45,7 +45,7 @@
"include_config_in_attributes": "include_config_in_attributes: A kapcsoló összes opciójának attribútumként való megjelenítése a Home Assistantben, ha a beállítás értéke `igaz`. 📝"
},
"title": "Adaptív világítás beállításai",
"description": "Egy Adaptív világítás komponens konfigurálása. Az opciók nevei a YAML-beállításokhoz igazodnak. Ha ezt a bejegyzést YAML-ben definiálta, itt nem jelennek meg beállítások. A paraméterek hatásait bemutató interaktív grafikonokért látogasson el [erre a webes alkalmazásra](https://basnijholt.github.io/adaptive-lighting). További részletekért olvasd el a [hivatalos dokumentációt](https://github.com/basnijholt/adaptive-lighting#readme)."
"description": "Egy Adaptív világítás komponens konfigurálása. Az opciók nevei a YAML-beállításokhoz igazodnak. Ha ezt a bejegyzést YAML-ben definiálta, itt nem jelennek meg beállítások. A paraméterek hatásait bemutató interaktív grafikonokért látogasson el [erre a webes alkalmazásra]({webapp_url}). További részletekért olvasd el a [hivatalos dokumentációt]({docs_url})."
}
},
"error": {

View file

@ -163,7 +163,7 @@
"data": {
"detect_non_ha_changes": "detect_non_ha_changes: Mendeteksi dan menghentikan adaptasi untuk perubahan status non-`light.turn_on`. Perlu mengaktifkan `take_over_control`. 🕵️ Perhatian: ⚠️ Beberapa lampu mungkin salah menunjukkan status 'hidup' yang dapat mengakibatkan lampu menyala secara tidak terduga. Nonaktifkan fitur ini jika Anda mengalami masalah seperti itu.",
"multi_light_intercept": "multi_light_intercept: Cegat dan sesuaikan panggilan `light.turn_on` yang menargetkan banyak lampu. ➗⚠️ Hal ini dapat mengakibatkan satu panggilan `light.turn_on` terpecah menjadi beberapa panggilan, misalnya saat lampu berada di sakelar yang berbeda. Membutuhkan `intercept` untuk diaktifkan.",
"adapt_only_on_bare_turn_on": "adapt_only_on_bare_turn_on: Saat menyalakan lampu pada awalnya. Jika disetel ke `true`, Pencahayaan Adaptif hanya beradaptasi jika `light.turn_on` dipanggil tanpa menentukan warna atau kecerahan. ❌🌈 Misalnya mencegah adaptasi saat mengaktifkan scene. Jika `false`, Pencahayaan Adaptif beradaptasi terlepas dari keberadaan warna atau kecerahan di `service_data` awal. Perlu mengaktifkan `take_over_control`. 🕵️ ",
"adapt_only_on_bare_turn_on": "adapt_only_on_bare_turn_on: Saat menyalakan lampu pada awalnya. Jika diatur ke `true`, AL hanya beradaptasi jika `light.turn_on` dipanggil tanpa menentukan warna atau kecerahan. ❌🌈 Misalnya, mencegah adaptasi ketika mengaktifkan scene. Jika `false`, AL akan beradaptasi tanpa menghiraukan keberadaan warna atau kecerahan dalam `service_data` awal. Perlu `take_over_control` diaktifkan. 🕵️",
"skip_redundant_commands": "skip_redundant_commands: Lewati pengiriman perintah adaptasi yang status targetnya sudah sama dengan status cahaya yang diketahui. Meminimalkan lalu lintas jaringan dan meningkatkan respons adaptasi dalam beberapa situasi. 📉Nonaktifkan jika status cahaya fisik tidak sinkron dengan status rekaman HA.",
"separate_turn_on_commands": "separate_turn_on_commands: Gunakan panggilan `light.turn_on` terpisah untuk warna dan kecerahan, diperlukan untuk beberapa jenis lampu. 🔀",
"max_color_temp": "max_color_temp: Suhu warna terdingin dalam Kelvin. ❄️",
@ -179,7 +179,7 @@
"include_config_in_attributes": "include_config_in_attributes: Tampilkan semua opsi sebagai atribut pada sakelar di Home Assistant ketika diatur ke `true`. 📝"
},
"title": "Opsi Pencahayaan Adaptif",
"description": "Konfigurasikan komponen Pencahayaan Adaptif. Nama opsi selaras dengan pengaturan YAML. Jika Anda telah menentukan entri ini di YAML, tidak ada opsi yang akan muncul di sini. Untuk grafik interaktif yang menunjukkan efek parameter, kunjungi [aplikasi web ini](https://basnijholt.github.io/adaptive-lighting). Untuk detail lebih lanjut, lihat [dokumentasi resmi](https://github.com/basnijholt/adaptive-lighting#readme)."
"description": "Konfigurasikan komponen Pencahayaan Adaptif. Nama opsi selaras dengan pengaturan YAML. Jika Anda telah menentukan entri ini di YAML, tidak ada opsi yang akan muncul di sini. Untuk grafik interaktif yang menunjukkan efek parameter, kunjungi [aplikasi web ini]({webapp_url}). Untuk detail lebih lanjut, lihat [dokumentasi resmi]({docs_url})."
}
},
"error": {

View file

@ -1,5 +1,5 @@
{
"title": "適応型照明",
"title": "明るさの自動調整",
"services": {
"change_switch_settings": {
"fields": {
@ -7,10 +7,13 @@
"description": "日の出時間を基準に秒単位で正値もしくは負値で調整する。⏰"
},
"only_once": {
"description": "適応型照明を照明がオンになっているときのみ(`true`)それとも適応し続ける場合は(`false`)。"
"description": "一度だけ明るさを自動調整するには(`true`)、常に自動調整し続ける場合は(`false`)。"
},
"sunset_offset": {
"description": "日の入時間を基準に秒単位で正値もしくは負値で調整する。⏰"
},
"entity_id": {
"description": "スイッチのエンティティID。 📝"
}
}
},
@ -32,7 +35,7 @@
"sunrise_offset": "日の出時間を基準に秒単位で正値もしくは負値で調整する。⏰",
"sunset_offset": "日の入時間を基準に秒単位で正値もしくは負値で調整する。⏰"
},
"title": "適応型照明オプション"
"title": "明るさの自動調整オプション"
}
}
}

View file

@ -1,269 +1,269 @@
{
"title": "적응형 조명",
"config": {
"step": {
"user": {
"title": "적응형 조명 인스턴스 이름 선택",
"description": "각 인스턴스는 여러 조명을 포함할 수 있습니다!",
"data": {
"name": "이름"
}
}
},
"abort": {
"already_configured": "이 장치는 이미 구성되었습니다"
"title": "적응형 조명",
"config": {
"step": {
"user": {
"title": "적응형 조명 인스턴스 이름 선택",
"description": "각 인스턴스는 여러 조명을 포함할 수 있습니다!",
"data": {
"name": "이름"
}
}
},
"options": {
"step": {
"init": {
"title": "적응형 조명 옵션",
"description": "적응형 조명 구성요소를 구성합니다. 옵션 이름은 YAML 설정과 일치합니다. 이 항목을 YAML에서 정의한 경우 여기에 옵션이 표시되지 않습니다. 매개변수 효과를 시연하는 인터랙티브 그래프는 [이 웹 앱](https://basnijholt.github.io/adaptive-lighting)에서 확인할 수 있습니다. 자세한 내용은 [공식 문서](https://github.com/basnijholt/adaptive-lighting#readme)를 참조하세요.",
"data": {
"lights": "조명: 제어될 조명 entity_ids의 목록 (비어 있을 수 있음). 🌟",
"interval": "간격",
"transition": "전환",
"initial_transition": "초기 전환",
"min_brightness": "최소 밝기: 밝기 최소 퍼센트. 💡",
"max_brightness": "최대 밝기: 밝기 최대 퍼센트. 💡",
"min_color_temp": "최소 색온도: 켈빈으로 표시된 가장 따뜻한 색온도. 🔥",
"max_color_temp": "최대 색온도: 켈빈으로 표시된 가장 차가운 색온도. ❄️",
"prefer_rgb_color": "RGB 색상 선호: 가능할 경우 색온도 조정보다 RGB 색상 조정을 선호하는지 여부. 🌈",
"sleep_brightness": "수면 밝기",
"sleep_rgb_or_color_temp": "수면 rgb_or_color_temp",
"sleep_color_temp": "수면 색온도",
"sleep_rgb_color": "수면 RGB 색상",
"sleep_transition": "수면 전환",
"transition_until_sleep": "수면까지 전환: 활성화되면, 적응형 조명은 수면 설정을 최소값으로 취급하고 일몰 후 이 값으로 전환합니다. 🌙",
"sunrise_time": "일출 시간",
"min_sunrise_time": "최소 일출 시간",
"max_sunrise_time": "최대 일출 시간",
"sunrise_offset": "일출 오프셋",
"sunset_time": "일몰 시간",
"min_sunset_time": "최소 일몰 시간",
"max_sunset_time": "최대 일몰 시간",
"sunset_offset": "일몰 오프셋",
"brightness_mode": "밝기 모드",
"brightness_mode_time_dark": "어두울 때 밝기 모드 시간",
"brightness_mode_time_light": "밝을 때 밝기 모드 시간",
"take_over_control": "제어 인계: 다른 소스가 조명이 켜져 있고 조정 중일 때 `light.turn_on`을 호출하면 적응형 조명을 비활성화합니다. 이는 매 `간격`마다 `homeassistant.update_entity`를 호출합니다! 🔒",
"detect_non_ha_changes": "비HA 변경 감지: `light.turn_on`이 아닌 상태 변경을 감지하고 조정을 중단합니다. `take_over_control`이 활성화되어 있어야 합니다. 🕵️ 주의: ⚠️ 일부 조명은 잘못된 '켜짐' 상태를 나타낼 수 있으며, 이로 인해 조명이 예상치 못하게 켜질 수 있습니다. 이러한 문제가 발생하면 이 기능을 비활성화하세요.",
"autoreset_control_seconds": "자동 제어 리셋 초",
"only_once": "한 번만: 조명을 켤 때만 조정 (`true`) 또는 계속해서 조정 (`false`). 🔄",
"adapt_only_on_bare_turn_on": "초기 켜짐 시 조정만: 조명을 처음 켤 때. `true`로 설정하면 `light.turn_on`이 색상이나 밝기를 지정하지 않고 호출될 때만 AL이 조정합니다. ❌🌈 예를 들어, 장면을 활성화할 때 조정을 방지합니다. `false`로 설정하면, AL은 초기 `service_data`에 색상이나 밝기의 존재 여부와 관계없이 조정합니다. `take_over_control`이 활성화되어 있어야 합니다. 🕵️",
"separate_turn_on_commands": "분리된 켜기 명령 사용: 일부 조명 유형에 필요한 색상과 밝기에 대해 별도의 `light.turn_on` 호출을 사용합니다. 🔀",
"send_split_delay": "분할 전송 지연",
"adapt_delay": "조정 지연",
"skip_redundant_commands": "중복 명령 건너뛰기: 목표 상태가 이미 조명의 알려진 상태와 동일한 조정 명령을 보내지 않습니다. 네트워크 트래픽을 최소화하고 일부 상황에서 조정 반응성을 향상시킵니다. 📉 물리적 조명 상태가 HA의 기록된 상태와 동기화되지 않는 경우 비활성화하세요.",
"intercept": "가로채기: 색상과 밝기의 즉각적인 조정을 가능하게 하기 위해 `light.turn_on` 호출을 가로챕니다. 🏎️ 색상과 밝기를 지원하지 않는 조명에 대해 비활성화합니다.",
"multi_light_intercept": "다중 조명 가로채기: 여러 조명을 대상으로 하는 `light.turn_on` 호출을 가로채고 조정합니다. ➗⚠️ 이는 단일 `light.turn_on` 호출을 여러 호출로 분할할 수 있음을 의미합니다. 예를 들어, 조명이 다른 스위치에 있을 때. `intercept`가 활성화되어 있어야 합니다.",
"include_config_in_attributes": "속성에 구성 포함: `true`로 설정하면 Home Assistant에서 스위치의 모든 옵션을 속성으로 표시합니다. 📝"
},
"data_description": {
"interval": "조명을 조정하는 빈도, 초 단위. 🔄",
"transition": "조명이 변경될 때 전환 기간, 초 단위. 🕑",
"initial_transition": "조명이 `off`에서 `on`으로 바뀔 때 첫 번째 전환의 지속 시간, 초 단위. ⏲️",
"sleep_brightness": "수면 모드에서 조명의 밝기 퍼센트. 😴",
"sleep_rgb_or_color_temp": "수면 모드에서 `\"rgb_color\"` 또는 `\"color_temp\"` 사용. 🌙",
"sleep_color_temp": "수면 모드에서 색온도 (sleep_rgb_or_color_temp가 `color_temp`일 때 사용) 켈빈 단위. 😴",
"sleep_rgb_color": "수면 모드에서 RGB 색상 (sleep_rgb_or_color_temp가 \"rgb_color\"일 때 사용). 🌈",
"sleep_transition": "\"수면 모드\"가 전환될 때 전환 기간, 초 단위. 😴",
"sunrise_time": "일출 시간을 고정된 시간 (HH:MM:SS)으로 설정. 🌅",
"min_sunrise_time": "가장 이른 가상 일출 시간 (HH:MM:SS)을 설정하여 더 늦은 일출을 허용. 🌅",
"max_sunrise_time": "가장 늦은 가상 일출 시간 (HH:MM:SS)을 설정하여 더 일찍 일출을 허용. 🌅",
"sunrise_offset": "양수 또는 음수 오프셋(초)으로 일출 시간을 조정. ⏰",
"sunset_time": "일몰 시간을 고정된 시간 (HH:MM:SS)으로 설정. 🌇",
"min_sunset_time": "가장 이른 가상 일몰 시간 (HH:MM:SS)을 설정하여 더 늦은 일몰을 허용. 🌇",
"max_sunset_time": "가장 늦은 가상 일몰 시간 (HH:MM:SS)을 설정하여 더 일찍 일몰을 허용. 🌇",
"sunset_offset": "양수 또는 음수 오프셋(초)으로 일몰 시간을 조정. ⏰",
"brightness_mode": "사용할 밝기 모드. 가능한 값은 `default`, `linear`, `tanh` (uses `brightness_mode_time_dark` and `brightness_mode_time_light`). 📈",
"brightness_mode_time_dark": "(`brightness_mode='default'`인 경우 무시됨) 일출/일몰 전/후에 밝기를 높이거나 낮추는 데 걸리는 시간, 초 단위. 📈📉",
"brightness_mode_time_light": "(`brightness_mode='default'`인 경우 무시됨) 일출/일몰 후/전에 밝기를 높이거나 낮추는 데 걸리는 시간, 초 단위. 📈📉.",
"autoreset_control_seconds": "특정 초 후에 수동 제어를 자동으로 재설정. 0으로 설정하면 비활성화됩니다. ⏲️",
"send_split_delay": "`separate_turn_on_commands`에 대한 호출 사이의 지연 시간(밀리초)으로, 밝기와 색상을 동시에 설정하지 않는 조명에 대한 지연. ⏲️",
"adapt_delay": "조명을 켠 후 적응형 조명이 변경 사항을 적용하기까지의 대기 시간(초). 깜박임을 피하는 데 도움이 될 수 있습니다. ⏲️"
}
}
},
"error": {
"option_error": "잘못된 옵션",
"entity_missing": "선택한 하나 이상의 조명 엔티티가 Home Assistant에서 누락됨"
}
},
"services": {
"apply": {
"name": "적용",
"description": "현재 적응형 조명 설정을 조명에 적용합니다.",
"fields": {
"entity_id": {
"description": "설정을 적용할 스위치의 `entity_id`. 📝",
"name": "entity_id"
},
"lights": {
"description": "설정을 적용할 조명(또는 조명 목록). 💡",
"name": "lights"
},
"transition": {
"description": "조명 변경 시 전환 기간, 초 단위. 🕑",
"name": "transition"
},
"adapt_brightness": {
"description": "조명의 밝기를 조정할지 여부. 🌞",
"name": "adapt_brightness"
},
"adapt_color": {
"description": "지원하는 조명의 색상을 조정할지 여부. 🌈",
"name": "adapt_color"
},
"prefer_rgb_color": {
"description": "가능할 경우 색온도 조정보다 RGB 색상 조정을 선호하는지 여부. 🌈",
"name": "prefer_rgb_color"
},
"turn_on_lights": {
"description": "현재 꺼져 있는 조명을 켤지 여부. 🔆",
"name": "turn_on_lights"
}
}
},
"set_manual_control": {
"name": "수동 제어 설정",
"description": "조명이 '수동 제어됨'으로 표시되었는지 여부를 표시합니다.",
"fields": {
"entity_id": {
"description": "`수동 제어됨`으로 (표시 해제)할 스위치의 `entity_id`. 📝",
"name": "entity_id"
},
"lights": {
"description": "조명의 entity_id(들), 지정하지 않으면 스위치의 모든 조명이 선택됩니다. 💡",
"name": "lights"
},
"manual_control": {
"description": "\"수동 제어\" 목록에서 조명을 추가(\"true\") 또는 제거(\"false\")할지 여부. 🔒",
"name": "manual_control"
}
}
},
"change_switch_settings": {
"name": "스위치 설정 변경",
"description": "스위치에서 원하는 모든 설정을 변경하세요. 여기에 있는 모든 옵션은 구성 흐름에서와 같습니다.",
"fields": {
"entity_id": {
"description": "스위치의 Entity ID. 📝",
"name": "entity_id"
},
"use_defaults": {
"description": "이 서비스 호출에서 지정되지 않은 기본값을 설정합니다. 옵션: \"현재\"(기본값, 현재 값을 유지), \"공장\"(문서화된 기본값으로 재설정), 또는 \"구성\"(스위치 구성 기본값으로 되돌림). ⚙️",
"name": "use_defaults"
},
"include_config_in_attributes": {
"description": "`true`로 설정하면 Home Assistant에서 스위치의 모든 옵션을 속성으로 표시합니다. 📝",
"name": "include_config_in_attributes"
},
"turn_on_lights": {
"description": "현재 꺼져 있는 조명을 켤지 여부. 🔆",
"name": "turn_on_lights"
},
"initial_transition": {
"description": "조명이 `off`에서 `on`으로 바뀔 때 첫 번째 전환의 지속 시간, 초 단위. ⏲️",
"name": "initial_transition"
},
"sleep_transition": {
"description": "\"수면 모드\"가 전환될 때 전환 기간, 초 단위. 😴",
"name": "sleep_transition"
},
"max_brightness": {
"description": "최대 밝기 퍼센트. 💡",
"name": "max_brightness"
},
"max_color_temp": {
"description": "켈빈으로 표시된 가장 차가운 색온도. ❄️",
"name": "max_color_temp"
},
"min_brightness": {
"description": "최소 밝기 퍼센트. 💡",
"name": "min_brightness"
},
"min_color_temp": {
"description": "켈빈으로 표시된 가장 따뜻한 색온도. 🔥",
"name": "min_color_temp"
},
"only_once": {
"description": "조명을 켤 때만 조정 (`true`) 또는 계속해서 조정 (`false`). 🔄",
"name": "only_once"
},
"prefer_rgb_color": {
"description": "가능할 경우 색온도 조정보다 RGB 색상 조정을 선호하는지 여부. 🌈",
"name": "prefer_rgb_color"
},
"separate_turn_on_commands": {
"description": "일부 조명 유형에 필요한 색상과 밝기에 대해 별도의 `light.turn_on` 호출을 사용합니다. 🔀",
"name": "separate_turn_on_commands"
},
"send_split_delay": {
"description": "밝기와 색상을 동시에 설정하지 않는 조명에 대한 `separate_turn_on_commands` 호출 사이의 지연 시간(밀리초). ⏲️",
"name": "send_split_delay"
},
"sleep_brightness": {
"description": "수면 모드에서 조명의 밝기 퍼센트. 😴",
"name": "sleep_brightness"
},
"sleep_rgb_or_color_temp": {
"description": "수면 모드에서 `\"rgb_color\"` 또는 `\"color_temp\"` 사용. 🌙",
"name": "sleep_rgb_or_color_temp"
},
"sleep_rgb_color": {
"description": "수면 모드에서 RGB 색상 (sleep_rgb_or_color_temp가 \"rgb_color\"일 때 사용). 🌈",
"name": "sleep_rgb_color"
},
"sleep_color_temp": {
"description": "수면 모드에서 색온도 (sleep_rgb_or_color_temp가 `color_temp`일 때 사용) 켈빈 단위. 😴",
"name": "sleep_color_temp"
},
"sunrise_offset": {
"description": "양수 또는 음수 오프셋(초)으로 일출 시간을 조정. ⏰",
"name": "sunrise_offset"
},
"sunrise_time": {
"description": "일출 시간을 고정된 시간 (HH:MM:SS)으로 설정. 🌅",
"name": "sunrise_time"
},
"sunset_offset": {
"description": "양수 또는 음수 오프셋(초)으로 일몰 시간을 조정. ⏰",
"name": "sunset_offset"
},
"sunset_time": {
"description": "일몰 시간을 고정된 시간 (HH:MM:SS)으로 설정. 🌇",
"name": "sunset_time"
},
"max_sunrise_time": {
"description": "가장 늦은 가상 일출 시간 (HH:MM:SS)을 설정하여 더 일찍 일출을 허용. 🌅",
"name": "max_sunrise_time"
},
"min_sunset_time": {
"description": "가장 이른 가상 일몰 시간 (HH:MM:SS)을 설정하여 더 늦은 일몰을 허용. 🌇",
"name": "min_sunset_time"
},
"take_over_control": {
"description": "다른 소스가 조명이 켜져 있고 조정 중일 때 `light.turn_on`을 호출하면 적응형 조명을 비활성화합니다. 이는 매 `간격`마다 `homeassistant.update_entity`를 호출합니다! 🔒",
"name": "take_over_control"
},
"detect_non_ha_changes": {
"description": "`light.turn_on`이 아닌 상태 변경을 감지하고 조정을 중단합니다. `take_over_control`이 활성화되어 있어야 합니다. 🕵️ 주의: ⚠️ 일부 조명은 잘못된 '켜짐' 상태를 나타낼 수 있으며, 이로 인해 조명이 예상치 못하게 켜질 수 있습니다. 이러한 문제가 발생하면 이 기능을 비활성화하세요.",
"name": "detect_non_ha_changes"
},
"transition": {
"description": "조명이 변경될 때 전환 기간, 초 단위. 🕑",
"name": "transition"
},
"adapt_delay": {
"description": "조명을 켠 후 적응형 조명이 변경 사항을 적용하기까지의 대기 시간(초). 깜박임을 피하는 데 도움이 될 수 있습니다. ⏲️",
"name": "adapt_delay"
},
"autoreset_control_seconds": {
"description": "특정 초 후에 수동 제어를 자동으로 재설정. 0으로 설정하면 비활성화됩니다. ⏲️",
"name": "autoreset_control_seconds"
}
}
}
"abort": {
"already_configured": "이 장치는 이미 구성되었습니다"
}
},
"options": {
"step": {
"init": {
"title": "적응형 조명 옵션",
"description": "적응형 조명 구성요소를 구성합니다. 옵션 이름은 YAML 설정과 일치합니다. 이 항목을 YAML에서 정의한 경우 여기에 옵션이 표시되지 않습니다. 매개변수 효과를 시연하는 인터랙티브 그래프는 [이 웹 앱]({webapp_url})에서 확인할 수 있습니다. 자세한 내용은 [공식 문서]({docs_url})를 참조하세요.",
"data": {
"lights": "조명: 제어될 조명 entity_ids의 목록 (비어 있을 수 있음). 🌟",
"interval": "간격",
"transition": "전환",
"initial_transition": "초기 전환",
"min_brightness": "최소 밝기: 밝기 최소 퍼센트. 💡",
"max_brightness": "최대 밝기: 밝기 최대 퍼센트. 💡",
"min_color_temp": "최소 색온도: 켈빈으로 표시된 가장 따뜻한 색온도. 🔥",
"max_color_temp": "최대 색온도: 켈빈으로 표시된 가장 차가운 색온도. ❄️",
"prefer_rgb_color": "RGB 색상 선호: 가능할 경우 색온도 조정보다 RGB 색상 조정을 선호하는지 여부. 🌈",
"sleep_brightness": "수면 밝기",
"sleep_rgb_or_color_temp": "수면 rgb_or_color_temp",
"sleep_color_temp": "수면 색온도",
"sleep_rgb_color": "수면 RGB 색상",
"sleep_transition": "수면 전환",
"transition_until_sleep": "수면까지 전환: 활성화되면, 적응형 조명은 수면 설정을 최소값으로 취급하고 일몰 후 이 값으로 전환합니다. 🌙",
"sunrise_time": "일출 시간",
"min_sunrise_time": "최소 일출 시간",
"max_sunrise_time": "최대 일출 시간",
"sunrise_offset": "일출 오프셋",
"sunset_time": "일몰 시간",
"min_sunset_time": "최소 일몰 시간",
"max_sunset_time": "최대 일몰 시간",
"sunset_offset": "일몰 오프셋",
"brightness_mode": "밝기 모드",
"brightness_mode_time_dark": "어두울 때 밝기 모드 시간",
"brightness_mode_time_light": "밝을 때 밝기 모드 시간",
"take_over_control": "제어 인계: 다른 소스가 조명이 켜져 있고 조정 중일 때 `light.turn_on`을 호출하면 적응형 조명을 비활성화합니다. 이는 매 `간격`마다 `homeassistant.update_entity`를 호출합니다! 🔒",
"detect_non_ha_changes": "비HA 변경 감지: `light.turn_on`이 아닌 상태 변경을 감지하고 조정을 중단합니다. `take_over_control`이 활성화되어 있어야 합니다. 🕵️ 주의: ⚠️ 일부 조명은 잘못된 '켜짐' 상태를 나타낼 수 있으며, 이로 인해 조명이 예상치 못하게 켜질 수 있습니다. 이러한 문제가 발생하면 이 기능을 비활성화하세요.",
"autoreset_control_seconds": "자동 제어 리셋 초",
"only_once": "한 번만: 조명을 켤 때만 조정 (`true`) 또는 계속해서 조정 (`false`). 🔄",
"adapt_only_on_bare_turn_on": "초기 켜짐 시 조정만: 조명을 처음 켤 때. `true`로 설정하면 `light.turn_on`이 색상이나 밝기를 지정하지 않고 호출될 때만 AL이 조정합니다. ❌🌈 예를 들어, 장면을 활성화할 때 조정을 방지합니다. `false`로 설정하면, AL은 초기 `service_data`에 색상이나 밝기의 존재 여부와 관계없이 조정합니다. `take_over_control`이 활성화되어 있어야 합니다. 🕵️",
"separate_turn_on_commands": "분리된 켜기 명령 사용: 일부 조명 유형에 필요한 색상과 밝기에 대해 별도의 `light.turn_on` 호출을 사용합니다. 🔀",
"send_split_delay": "분할 전송 지연",
"adapt_delay": "조정 지연",
"skip_redundant_commands": "중복 명령 건너뛰기: 목표 상태가 이미 조명의 알려진 상태와 동일한 조정 명령을 보내지 않습니다. 네트워크 트래픽을 최소화하고 일부 상황에서 조정 반응성을 향상시킵니다. 📉 물리적 조명 상태가 HA의 기록된 상태와 동기화되지 않는 경우 비활성화하세요.",
"intercept": "가로채기: 색상과 밝기의 즉각적인 조정을 가능하게 하기 위해 `light.turn_on` 호출을 가로챕니다. 🏎️ 색상과 밝기를 지원하지 않는 조명에 대해 비활성화합니다.",
"multi_light_intercept": "다중 조명 가로채기: 여러 조명을 대상으로 하는 `light.turn_on` 호출을 가로채고 조정합니다. ➗⚠️ 이는 단일 `light.turn_on` 호출을 여러 호출로 분할할 수 있음을 의미합니다. 예를 들어, 조명이 다른 스위치에 있을 때. `intercept`가 활성화되어 있어야 합니다.",
"include_config_in_attributes": "속성에 구성 포함: `true`로 설정하면 Home Assistant에서 스위치의 모든 옵션을 속성으로 표시합니다. 📝"
},
"data_description": {
"interval": "조명을 조정하는 빈도, 초 단위. 🔄",
"transition": "조명이 변경될 때 전환 기간, 초 단위. 🕑",
"initial_transition": "조명이 `off`에서 `on`으로 바뀔 때 첫 번째 전환의 지속 시간, 초 단위. ⏲️",
"sleep_brightness": "수면 모드에서 조명의 밝기 퍼센트. 😴",
"sleep_rgb_or_color_temp": "수면 모드에서 `\"rgb_color\"` 또는 `\"color_temp\"` 사용. 🌙",
"sleep_color_temp": "수면 모드에서 색온도 (sleep_rgb_or_color_temp가 `color_temp`일 때 사용) 켈빈 단위. 😴",
"sleep_rgb_color": "수면 모드에서 RGB 색상 (sleep_rgb_or_color_temp가 \"rgb_color\"일 때 사용). 🌈",
"sleep_transition": "\"수면 모드\"가 전환될 때 전환 기간, 초 단위. 😴",
"sunrise_time": "일출 시간을 고정된 시간 (HH:MM:SS)으로 설정. 🌅",
"min_sunrise_time": "가장 이른 가상 일출 시간 (HH:MM:SS)을 설정하여 더 늦은 일출을 허용. 🌅",
"max_sunrise_time": "가장 늦은 가상 일출 시간 (HH:MM:SS)을 설정하여 더 일찍 일출을 허용. 🌅",
"sunrise_offset": "양수 또는 음수 오프셋(초)으로 일출 시간을 조정. ⏰",
"sunset_time": "일몰 시간을 고정된 시간 (HH:MM:SS)으로 설정. 🌇",
"min_sunset_time": "가장 이른 가상 일몰 시간 (HH:MM:SS)을 설정하여 더 늦은 일몰을 허용. 🌇",
"max_sunset_time": "가장 늦은 가상 일몰 시간 (HH:MM:SS)을 설정하여 더 일찍 일몰을 허용. 🌇",
"sunset_offset": "양수 또는 음수 오프셋(초)으로 일몰 시간을 조정. ⏰",
"brightness_mode": "사용할 밝기 모드. 가능한 값은 `default`, `linear`, `tanh` (uses `brightness_mode_time_dark` and `brightness_mode_time_light`). 📈",
"brightness_mode_time_dark": "(`brightness_mode='default'`인 경우 무시됨) 일출/일몰 전/후에 밝기를 높이거나 낮추는 데 걸리는 시간, 초 단위. 📈📉",
"brightness_mode_time_light": "(`brightness_mode='default'`인 경우 무시됨) 일출/일몰 후/전에 밝기를 높이거나 낮추는 데 걸리는 시간, 초 단위. 📈📉.",
"autoreset_control_seconds": "특정 초 후에 수동 제어를 자동으로 재설정. 0으로 설정하면 비활성화됩니다. ⏲️",
"send_split_delay": "`separate_turn_on_commands`에 대한 호출 사이의 지연 시간(밀리초)으로, 밝기와 색상을 동시에 설정하지 않는 조명에 대한 지연. ⏲️",
"adapt_delay": "조명을 켠 후 적응형 조명이 변경 사항을 적용하기까지의 대기 시간(초). 깜박임을 피하는 데 도움이 될 수 있습니다. ⏲️"
}
}
},
"error": {
"option_error": "잘못된 옵션",
"entity_missing": "선택한 하나 이상의 조명 엔티티가 Home Assistant에서 누락됨"
}
},
"services": {
"apply": {
"name": "적용",
"description": "현재 적응형 조명 설정을 조명에 적용합니다.",
"fields": {
"entity_id": {
"description": "설정을 적용할 스위치의 `entity_id`. 📝",
"name": "entity_id"
},
"lights": {
"description": "설정을 적용할 조명(또는 조명 목록). 💡",
"name": "lights"
},
"transition": {
"description": "조명 변경 시 전환 기간, 초 단위. 🕑",
"name": "transition"
},
"adapt_brightness": {
"description": "조명의 밝기를 조정할지 여부. 🌞",
"name": "adapt_brightness"
},
"adapt_color": {
"description": "지원하는 조명의 색상을 조정할지 여부. 🌈",
"name": "adapt_color"
},
"prefer_rgb_color": {
"description": "가능할 경우 색온도 조정보다 RGB 색상 조정을 선호하는지 여부. 🌈",
"name": "prefer_rgb_color"
},
"turn_on_lights": {
"description": "현재 꺼져 있는 조명을 켤지 여부. 🔆",
"name": "turn_on_lights"
}
}
},
"set_manual_control": {
"name": "수동 제어 설정",
"description": "조명이 '수동 제어됨'으로 표시되었는지 여부를 표시합니다.",
"fields": {
"entity_id": {
"description": "`수동 제어됨`으로 (표시 해제)할 스위치의 `entity_id`. 📝",
"name": "entity_id"
},
"lights": {
"description": "조명의 entity_id(들), 지정하지 않으면 스위치의 모든 조명이 선택됩니다. 💡",
"name": "lights"
},
"manual_control": {
"description": "\"수동 제어\" 목록에서 조명을 추가(\"true\") 또는 제거(\"false\")할지 여부. 🔒",
"name": "manual_control"
}
}
},
"change_switch_settings": {
"name": "스위치 설정 변경",
"description": "스위치에서 원하는 모든 설정을 변경하세요. 여기에 있는 모든 옵션은 구성 흐름에서와 같습니다.",
"fields": {
"entity_id": {
"description": "스위치의 Entity ID. 📝",
"name": "entity_id"
},
"use_defaults": {
"description": "이 서비스 호출에서 지정되지 않은 기본값을 설정합니다. 옵션: \"현재\"(기본값, 현재 값을 유지), \"공장\"(문서화된 기본값으로 재설정), 또는 \"구성\"(스위치 구성 기본값으로 되돌림). ⚙️",
"name": "use_defaults"
},
"include_config_in_attributes": {
"description": "`true`로 설정하면 Home Assistant에서 스위치의 모든 옵션을 속성으로 표시합니다. 📝",
"name": "include_config_in_attributes"
},
"turn_on_lights": {
"description": "현재 꺼져 있는 조명을 켤지 여부. 🔆",
"name": "turn_on_lights"
},
"initial_transition": {
"description": "조명이 `off`에서 `on`으로 바뀔 때 첫 번째 전환의 지속 시간, 초 단위. ⏲️",
"name": "initial_transition"
},
"sleep_transition": {
"description": "\"수면 모드\"가 전환될 때 전환 기간, 초 단위. 😴",
"name": "sleep_transition"
},
"max_brightness": {
"description": "최대 밝기 퍼센트. 💡",
"name": "max_brightness"
},
"max_color_temp": {
"description": "켈빈으로 표시된 가장 차가운 색온도. ❄️",
"name": "max_color_temp"
},
"min_brightness": {
"description": "최소 밝기 퍼센트. 💡",
"name": "min_brightness"
},
"min_color_temp": {
"description": "켈빈으로 표시된 가장 따뜻한 색온도. 🔥",
"name": "min_color_temp"
},
"only_once": {
"description": "조명을 켤 때만 조정 (`true`) 또는 계속해서 조정 (`false`). 🔄",
"name": "only_once"
},
"prefer_rgb_color": {
"description": "가능할 경우 색온도 조정보다 RGB 색상 조정을 선호하는지 여부. 🌈",
"name": "prefer_rgb_color"
},
"separate_turn_on_commands": {
"description": "일부 조명 유형에 필요한 색상과 밝기에 대해 별도의 `light.turn_on` 호출을 사용합니다. 🔀",
"name": "separate_turn_on_commands"
},
"send_split_delay": {
"description": "밝기와 색상을 동시에 설정하지 않는 조명에 대한 `separate_turn_on_commands` 호출 사이의 지연 시간(밀리초). ⏲️",
"name": "send_split_delay"
},
"sleep_brightness": {
"description": "수면 모드에서 조명의 밝기 퍼센트. 😴",
"name": "sleep_brightness"
},
"sleep_rgb_or_color_temp": {
"description": "수면 모드에서 `\"rgb_color\"` 또는 `\"color_temp\"` 사용. 🌙",
"name": "sleep_rgb_or_color_temp"
},
"sleep_rgb_color": {
"description": "수면 모드에서 RGB 색상 (sleep_rgb_or_color_temp가 \"rgb_color\"일 때 사용). 🌈",
"name": "sleep_rgb_color"
},
"sleep_color_temp": {
"description": "수면 모드에서 색온도 (sleep_rgb_or_color_temp가 `color_temp`일 때 사용) 켈빈 단위. 😴",
"name": "sleep_color_temp"
},
"sunrise_offset": {
"description": "양수 또는 음수 오프셋(초)으로 일출 시간을 조정. ⏰",
"name": "sunrise_offset"
},
"sunrise_time": {
"description": "일출 시간을 고정된 시간 (HH:MM:SS)으로 설정. 🌅",
"name": "sunrise_time"
},
"sunset_offset": {
"description": "양수 또는 음수 오프셋(초)으로 일몰 시간을 조정. ⏰",
"name": "sunset_offset"
},
"sunset_time": {
"description": "일몰 시간을 고정된 시간 (HH:MM:SS)으로 설정. 🌇",
"name": "sunset_time"
},
"max_sunrise_time": {
"description": "가장 늦은 가상 일출 시간 (HH:MM:SS)을 설정하여 더 일찍 일출을 허용. 🌅",
"name": "max_sunrise_time"
},
"min_sunset_time": {
"description": "가장 이른 가상 일몰 시간 (HH:MM:SS)을 설정하여 더 늦은 일몰을 허용. 🌇",
"name": "min_sunset_time"
},
"take_over_control": {
"description": "다른 소스가 조명이 켜져 있고 조정 중일 때 `light.turn_on`을 호출하면 적응형 조명을 비활성화합니다. 이는 매 `간격`마다 `homeassistant.update_entity`를 호출합니다! 🔒",
"name": "take_over_control"
},
"detect_non_ha_changes": {
"description": "`light.turn_on`이 아닌 상태 변경을 감지하고 조정을 중단합니다. `take_over_control`이 활성화되어 있어야 합니다. 🕵️ 주의: ⚠️ 일부 조명은 잘못된 '켜짐' 상태를 나타낼 수 있으며, 이로 인해 조명이 예상치 못하게 켜질 수 있습니다. 이러한 문제가 발생하면 이 기능을 비활성화하세요.",
"name": "detect_non_ha_changes"
},
"transition": {
"description": "조명이 변경될 때 전환 기간, 초 단위. 🕑",
"name": "transition"
},
"adapt_delay": {
"description": "조명을 켠 후 적응형 조명이 변경 사항을 적용하기까지의 대기 시간(초). 깜박임을 피하는 데 도움이 될 수 있습니다. ⏲️",
"name": "adapt_delay"
},
"autoreset_control_seconds": {
"description": "특정 초 후에 수동 제어를 자동으로 재설정. 0으로 설정하면 비활성화됩니다. ⏲️",
"name": "autoreset_control_seconds"
}
}
}
}
}

View file

@ -18,7 +18,7 @@
"step": {
"init": {
"title": "Adaptieve verlichting instellingen",
"description": "Alle instellingen voor een Adaptieve verlichting component. De optienamen komen overeen met de YAML-instellingen. Er worden geen opties weergegeven als u het item `adaptive_lighting` hebt gedefinieerd in uw YAML-configuratie.\nVoor een demonstratie met interactieve grafieken, parameters en effecten, bezoek [deze web applicatie](https://basnijholt.github.io/adaptive-lighting). Voor verdere details, bekijk de [officiële documentatie](https://github.com/basnijholt/adaptive-lighting#readme).",
"description": "Alle instellingen voor een Adaptieve verlichting component. De optienamen komen overeen met de YAML-instellingen. Er worden geen opties weergegeven als u het item `adaptive_lighting` hebt gedefinieerd in uw YAML-configuratie.\nVoor een demonstratie met interactieve grafieken, parameters en effecten, bezoek [deze web applicatie]({webapp_url}). Voor verdere details, bekijk de [officiële documentatie]({docs_url}).",
"data": {
"lights": "Lampen: lijst van `light` entiteiten om te bedienen (kan leeg zijn). 🌟",
"initial_transition": "initial_transition: Wanneer lichten van 'uit' naar 'aan' gaan. (seconden)",
@ -43,10 +43,10 @@
"sunset_time": "sunset_time: handmatige onderdrukking van de zonsondergangstijd, indien 'Geen', wordt de werkelijke zonsopgangstijd op uw locatie gebruikt (UU:MM:SS)",
"min_sunset_time": "min_sunset_time: handmatige onderdrukking van de minimale zonsondergangstijd, indien 'Geen', wordt de werkelijke zonsondergangstijd op uw locatie gebruikt (UU:MM:SS)",
"take_over_control": "take_over_control: Als iets anders dan Adaptieve verlichting 'light.turn_on' roept wanneer een lamp al aan is, stop dan met het aanpassen van het licht totdat het (of de schakelaar) uit -> aan gaat.",
"detect_non_ha_changes": "detect_non_ha_changes: detecteert alle >10% wijzigingen aan de lichten (ook buiten HA), vereist dat 'take_over_control' is ingeschakeld (heet 'homeassistant.update_entity' elke 'interval'!)",
"detect_non_ha_changes": "detect_non_ha_changes: Detecteert en stopt aanpassingen voor`light.turn_on` statuswijzigingen. Vereist dat`take_over_control` is ingeschakeld. 🕵️ Voorzichtig: ⚠️ Sommige lampen kunnen een 'aan' status vals aangeven, wat kan leiden tot onverwacht inschakelen van lampen. Schakel deze functie uit als je dergelijke problemen tegenkomt.",
"transition": "Overgangstijd bij het aanbrengen van een wijziging op de lichten (seconden)",
"adapt_delay": "adapt_delay: wachttijd tussen het inschakelen van het licht (seconden) en het aanbrengen van wijzigingen in de lichtstatus door Adaptieve verlichting. Kan flikkering voorkomen.",
"adapt_only_on_bare_turn_on": "adapt_only_on_bare_turn_on: Bij het initieel inschakelen van de lampen. Als dit op `true` is ingesteld, past Av alleen aan als `light.turn_on` wordt aangeroepen zonder een kleur of helderheid te specificeren. ❌🌈 Dit voorkomt bijvoorbeeld aanpassing bij het activeren van een scène. Als het `false` is, past Av aan ongeacht de aanwezigheid van kleur of helderheid in de initiële `service_data`. `take_over_control` moet ingeschakeld zijn. 🕵️ ",
"adapt_only_on_bare_turn_on": "adapt_only_on_bare_turn_on: Bij het initieel inschakelen van de lampen. Als dit op `true` is ingesteld, past Av alleen aan als `light.turn_on` wordt aangeroepen zonder een kleur of helderheid te specificeren. ❌🌈 Dit voorkomt bijvoorbeeld aanpassing bij het activeren van een scène. Als het `false` is, past Av aan ongeacht de aanwezigheid van kleur of helderheid in de initiële `service_data`. `take_over_control` moet ingeschakeld zijn. 🕵️",
"transition_until_sleep": "transition_until_sleep: Wanneer ingeschakeld, zal Adaptieve verlichting de slaapinstellingen behandelen als het minimum, overgaand naar deze waarden na zonsondergang. 🌙",
"skip_redundant_commands": "skip_redundant_commands: Sla het verzenden van aanpassingscommando's over waarvan de doelstatus al gelijk is aan de bekende status van de lamp. Minimaliseert netwerkverkeer en verbetert de responsiviteit van de aanpassing in sommige situaties. 📉Schakel uit als de fysieke lichtstatus niet meer synchroon loopt met de door HA geregistreerde status.",
"intercept": "intercept: Onderschep en pas `light.turn_on` oproepen aan om directe kleur- en helderheidsaanpassing mogelijk te maken. 🏎️ Schakel uit voor lampen die `light.turn_on` niet ondersteunen met kleur en helderheid.",
@ -121,7 +121,7 @@
"description": "Duur van de eerste overgang wanneer de lampen van `uit` naar `aan`gaan, in seconden. ⏲️"
},
"take_over_control": {
"description": "Schakel Adaptieve verlichting uit wanneer een andere bron `light.turn_on` aanroept terwijl de lampen aan staan en worden aangepast. N.b. dit zal `homeassistant.update_entity` elke `interval` uitvoeren."
"description": "Schakel Adaptieve verlichting uit als een andere bron `light.turn_on` aanroept terwijl de lampen aan zijn en worden aangepast. Let op dit roept`homeassistant.update_entity` elke `interval`aan."
},
"detect_non_ha_changes": {
"description": "Detecteert en stopt aanpassingen voor niet-`light.turn_on` state veranderingen. `take_over_control` moet actief zijn. 🕵️ Let op:⚠️Sommige lampen kunnen incorrect een 'on' state weergeven, wat resulteert in lampen die onverwacht aan gaan. Schakel deze feature uit wanneer deze fout zich voordoet."

View file

@ -18,7 +18,7 @@
"step": {
"init": {
"title": "Opcje adaptacyjnego oświetlenia",
"description": "Konfiguracja komponentu Adaptacyjnego oświetlenia. Nazwy opcji odpowiadają ustawieniom YAML. Żadne opcje nie są wyświetlane, jeśli są zdefiniowane w konfiguracji YAML. Aby zobaczyć interaktywne wykresy demonstrujące działanie parametrów odwiedź [tą aplikację webową](https://basnijholt.github.io/adaptive-lighting). Aby zobaczyć więcej szczegółów odwiedź [oficjalną dokumentację](https://github.com/basnijholt/adaptive-lighting#readme).",
"description": "Konfiguracja komponentu Adaptacyjnego oświetlenia. Nazwy opcji odpowiadają ustawieniom YAML. Żadne opcje nie są wyświetlane, jeśli są zdefiniowane w konfiguracji YAML. Aby zobaczyć interaktywne wykresy demonstrujące działanie parametrów odwiedź [tą aplikację webową]({webapp_url}). Aby zobaczyć więcej szczegółów odwiedź [oficjalną dokumentację]({docs_url}).",
"data": {
"lights": "lights: Lista `entity_id`, które mają być kontrolowane (może być pusta). 🌟",
"initial_transition": "initial_transition: When lights turn 'off' to 'on'. (sekund)",
@ -41,7 +41,7 @@
"detect_non_ha_changes": "detect_non_ha_changes: Wykrywa i zatrzymuje adaptacje oświetlenia przy zmianach nie pochodzących od `light.turn_on`. Wymaga aktywnego `take_over_control`. 🕵️ Uwaga: ⚠️ Niektóre światła mogą błędnie wskazywać stan \"on\", co może powodować nieoczekiwane włączanie się świateł. Wyłącz to ustawienie, jeżeli doświadczasz takich objawów.",
"transition": "Transition time when applying a change to the lights (sekund)",
"transition_until_sleep": "transition_until_sleep: Gdy włączone, Adaptacyjne oświetlenie będzie traktowało ustawienia spania jako minimalne i przejdzie do nich po zachodzie słońca. 🌙",
"adapt_only_on_bare_turn_on": "adapt_only_on_bare_turn_on: Gdy włączone (`true`) to adaptacyjne oświetlenie zastosuje adaptacje tylko jeżeli `light.turn_on` jest wywołane bez konkretnego koloru lub jasności. ❌🌈 To ustawienie zapobiega między innymi adaptacji, gdy aktywowana jest scena. Gdy wyłączone (`false`), adaptacyjne oświetlenie zastosuje adaptacje niezależnie czy `service_data` zawiera kolor lub jasność. Potrzebuje włączonej opcji `take_over_control`. 🕵️ ",
"adapt_only_on_bare_turn_on": "adapt_only_on_bare_turn_on: Gdy włączone (`true`) to adaptacyjne oświetlenie zastosuje adaptacje tylko jeżeli `light.turn_on` jest wywołane bez konkretnego koloru lub jasności. ❌🌈 To ustawienie zapobiega między innymi adaptacji, gdy aktywowana jest scena. Gdy wyłączone (`false`), adaptacyjne oświetlenie zastosuje adaptacje niezależnie czy `service_data` zawiera kolor lub jasność. Potrzebuje włączonej opcji `take_over_control`. 🕵️",
"skip_redundant_commands": "skip_redundant_commands: Pomiń wysyłanie polecenia adaptacji, jeżeli stan światła jest taki sam jak docelowy stan adaptacji. Minimalizuje to ruch sieciowy oraz w niektórych przypadkach poprawia szybkość działania. 📉 Wyłącz, jeżeli faktyczny stan światła się nie pokrywa z tym który widnieje w Home Assistant.",
"include_config_in_attributes": "include_config_in_attributes: Gdy włączone (`true`) pokaż ustawienia jako atrybuty w encji przełącznika w Home Assistant. 📝",
"intercept": "intercept: Przechwyć i zaadaptuj wywołanie `light.turn_on`, aby błyskawicznie dostosować kolor i jasność. 🏎️ Wyłącz dla świateł, które nie akceptują wywołania `light.turn_on` zawierającego kolor i jasność.",

View file

@ -39,7 +39,11 @@
"sunset_time": "sunset_time: substituição manual do horário do pôr do sol, se 'Nenhum', ele usa o horário real do nascer do sol em sua localização (HH:MM:SS)",
"take_over_control": "take_over_control: Se qualquer coisa, exceto Adaptive Lighting, chamar 'light.turn_on' quando uma luz já estiver acesa, pare de adaptar essa luz até que ela (ou o interruptor) desligue -> ligue.",
"detect_non_ha_changes": "detect_non_ha_changes: detecta todas as alterações > 10% feitas nas luzes (também fora do HA), requer que 'take_over_control' seja ativado (chama 'homeassistant.update_entity' a cada 'intervalo'!)",
"transition": "Tempo de transição ao aplicar uma mudança nas luzes (segundos)"
"transition": "Tempo de transição ao aplicar uma mudança nas luzes (segundos)",
"skip_redundant_commands": "skip_redundant_commands: Deixar de enviar comandos de adaptação cujo estado alvo já seja igual ao estado atual da luz. Minimiza o tráfego de rede e melhora a responsividade da adaptação em algumas situações. 📉Desative se os estados físicos das luzes podem ficar diferentes do estado registrado no HA.",
"transition_until_sleep": "transition_until_sleep: Quando ativada, a Iluminação Adaptativa considerará as configurações de sono como o valor mínimo, transicionando para esses valores após o pôr do sol. 🌙",
"adapt_only_on_bare_turn_on": "adapt_only_on_bare_turn_on: Ao ligar as luzes inicialmente. Se definido como `true`, a Iluminação Adaptativa se adapta somente se o comando `light.turn_on` for chamado sem especificar cor ou brilho. ❌🌈 Isso, por exemplo, impede a adaptação ao ativar uma cena. Se false, a Iluminação Adaptativa se adapta independentemente da presença de cor ou brilho nos dados iniciais do `service_data`. Precisa de `take_over_control` ativado. 🕵️",
"intercept": "intercept: Interceptar e adaptar os chamados `light.turn_on` para ativar a adaptação instantânea de cor e brilho. 🏎️ Desative para luzes que não suportam `light.turn_on` com cor e brilho."
}
}
},

View file

@ -26,8 +26,15 @@
},
"transition": {
"description": "Duração da transição quando as luzes mudam, em segundos. 🕑"
},
"max_color_temp": {
"description": "Cor mais fria em Kelvin. ❄️"
},
"sleep_brightness": {
"description": "Porcentagem do brilho da lâmpadas no modo \"sleep mode\"."
}
}
},
"description": "Muda alguma configuração que você quiser no interruptor. Todas as opções aqui são as mesmas que estão no processo de configuração."
},
"apply": {
"description": "Aplica as definições atuais da Iluminação Adaptativa às luzes.",
@ -60,9 +67,22 @@
"sunset_offset": "Ajustar a hora do pôr do sol com um offset positivo ou negativo em segundos. ⏰",
"sleep_transition": "Duração da transição quando o \"modo dormir\" é alternado em segundos. 😴",
"autoreset_control_seconds": "Reiniciar o controlo manual automaticamente após um número de segundos. Definir 0 para desativar. ⏲️",
"transition": "Duração da transição quando as luzes mudam, em segundos. 🕑"
"transition": "Duração da transição quando as luzes mudam, em segundos. 🕑",
"sleep_brightness": "Porcentagem do brilho da lâmpadas no modo \"sleep mode\".",
"brightness_mode": "Brilho que irá ser usado. Possíveis valores são `default`, `linear` e `tanh`(usa `brightness_mode_time_dark` e `brightness_mode_time_light`). 📈"
},
"title": "Opções da Iluminação Adaptativa"
"title": "Opções da Iluminação Adaptativa",
"description": "Configure um componente da Iluminação Adaptativa. O nome das opções são as mesmas que as do YML. Se você já definiu essa configuração no YAML, nenhuma opção vai aparecer aqui. Para acessar um gráfico que demonstra o efeito dos parâmetros, acesse [esse app]({webapp_url}). Para mais detalhes, veja a [documentação oficial]({docs_url}).",
"data": {
"lights": "lights: Lista das entity_ids das luzes para serem controladas (pode ser vazia). 🌟",
"min_brightness": "min_brightness: Percentagem minima de brilho. 💡",
"max_brightness": "max_brightness: Percentagem máxima de brilho. 💡",
"min_color_temp": "min_color_temp: Cor mais quente em Kelvin. 🔥",
"max_color_temp": "max_color_temp: Cor mais fria em Kelvin. ❄️",
"prefer_rgb_color": "prefer_rgb_color: Quando possível escolher ajuste em RGB em vez de temperatura da cor. 🌈",
"transition_until_sleep": "transition_until_sleep: Quando ativado, Adaptive Lighting usará as definições do modo noturno como os mínimos, passando para esses valores no por do sol. 🌙",
"take_over_control": "take_over_control: Desativa Adaptive Lighting se alguma fonte chamar`light.turn_on` enquanto as luzes estiverem ligadas e a serem controladas. Tomar nota que esta opção chama o serviço `homeassistant.update_entity` a cada `interval`! 🔒"
}
}
},
"error": {

View file

@ -2,8 +2,12 @@
"config": {
"step": {
"user": {
"description": "Fiecare instanţă poate conţine mai multe lumini!"
"description": "Fiecare instanţă poate conţine mai multe lumini!",
"title": "Alege un nume pentru instanța de Iluminare Adaptivă"
}
},
"abort": {
"already_configured": "Acest dispozitiv este deja configurat"
}
},
"options": {

View file

@ -42,7 +42,7 @@
"transition": "Время перехода при применении изменения к источникам света. (секунды)",
"adapt_delay": "Время ожидания между включением света и применением адаптации. Может помочь избежать мерцания. (секунды)",
"multi_light_intercept": "multi_light_intercept: перехватывает и адаптирует вызовы `light.turn_on`, нацеленные на несколько источников света. ➗⚠️ Это может привести к разделению одного вызова `light.turn_on` на несколько вызовов, например, когда освещение включено в разные выключатели. Требуется, чтобы `перехват` был включен.",
"adapt_only_on_bare_turn_on": "Adapt_only_on_bare_turn_on: При первоначальном включении света. Если установлено значение «true», AL адаптируется только в том случае, если «light.turn_on» вызывается без указания цвета или яркости. ❌🌈 Это, например, предотвращает адаптацию при активации сцены. Если false, AL адаптируется независимо от наличия цвета или яркости в исходных service_data. Требуется включить take_over_control. 🕵️ ",
"adapt_only_on_bare_turn_on": "Adapt_only_on_bare_turn_on: При первоначальном включении света. Если установлено значение «true», AL адаптируется только в том случае, если «light.turn_on» вызывается без указания цвета или яркости. ❌🌈 Это, например, предотвращает адаптацию при активации сцены. Если false, AL адаптируется независимо от наличия цвета или яркости в исходных service_data. Требуется включить take_over_control. 🕵️",
"skip_redundant_commands": "Skip_redundant_commands: Пропустить отправку команд адаптации, целевое состояние которых уже равно известному состоянию источника света. Минимизирует сетевой трафик и улучшает скорость адаптации в некоторых ситуациях. 📉Отключите, если физические состояния освещения не синхронизируются с записанным состоянием HA.",
"intercept": "intercept: перехватывать и адаптировать вызовы `light.turn_on` для обеспечения мгновенной адаптации цвета и яркости. 🏎️ Отключите источники света, которые не поддерживают `light.turn_on` с цветом и яркостью.",
"include_config_in_attributes": "include_config_in_attributes: отображать все параметры в качестве атрибутов на переключателе в Home Assistant, если установлено значение `true`. 📝",

View file

@ -36,7 +36,7 @@
"sunrise_offset": "Upravte čas východu slnka o sekundy vpred alebo vzad. ⏰",
"transition": "Trvanie prechodu, keď sú svetlá zmenené (v sekundách). ⏲️",
"brightness_mode": "Výber režimu jasu. Možné hodnotu sú `default`, `linear` a `tanh` (používa `brightness_mode_time_dark` a `brightness_mode_time_light`). 📈",
"brightness_mode_time_light": "(Ignorované ak `brightness_mode='default'`) Čas na zvýšenie/zníženie jasu po udalosti/pred udalosťou východu/západu slnka. 📈📉",
"brightness_mode_time_light": "(Ignorovaný, ak `brightness_mode = 'predvolené') Trvanie v sekundách na rampu / vypnutie jasu po / pred východ slnka/sunset. 📈📉.",
"sunset_offset": "Upravte čas západu slnka o sekundy vpred alebo vzad. ⏰",
"max_sunset_time": "Nastavte najneskorší možný virtuálny západ slnka (HH:MM:SS). Umožňuje skorší západ slnka. 🌅",
"initial_transition": "Trvanie prvého prechodu, keď sú svetlá zapnuté z `off` na `on` (v sekundách). ⏲️",
@ -45,7 +45,7 @@
"send_split_delay": "Pauza (v ms) medzi príkazmi pri zapnutom `separate_turn_on_commands` pre svetlá, ktoré nepodporujú súčasné nastavenie jasu a teploty svetla. ⏲️"
},
"title": "Nastavenia Adaptívneho osvetlenia",
"description": "Nastavte komponentu Adaptívneho osvetlenia. Názvy nastavení sú zhodné s názvami v súbore YAML. Ak ste túto položku nastavili už v YAML, tak tu sa nezobrazia žiadne možnosti nastavenia. Interaktívne grafy, ktoré zobrazujú vplyv nastavení, nájdete na [tejto webovej aplikácii](https://basnijholt.github.io/adaptive-lighting). Ďalšie informácie nájdete v [oficiálnej dokumentácii](https://github.com/basnijholt/adaptive-lighting#readme)."
"description": "Nastavte komponentu Adaptívneho osvetlenia. Názvy nastavení sú zhodné s názvami v súbore YAML. Ak ste túto položku nastavili už v YAML, tak tu sa nezobrazia žiadne možnosti nastavenia. Interaktívne grafy, ktoré zobrazujú vplyv nastavení, nájdete na [tejto webovej aplikácii]({webapp_url}). Ďalšie informácie nájdete v [oficiálnej dokumentácii]({docs_url})."
}
},
"error": {
@ -132,7 +132,7 @@
"description": "Prispôsobiť svetlá len pri zapnutí (`true`) alebo prispôsobovať ich priebežne (`false`). 🔄"
},
"use_defaults": {
"description": "Nastaví predvolené hodnoty, ktoré nie sú špecifikované v tomto volaní služby. Možnosti: \"current\" (predvolené, zachová aktuálne hodnoty), \"factory\" (použije predvolené hodnoty z dokumentácie) alebo \"configuration\" (vráti na predvolené nastavenia prepínača). ⚙️"
"description": "Stanovuje predvolené hodnoty nie sú uvedené v tomto servisnom hovore. Možnosti: \"current\" (predvolené, zachováva aktuálne hodnoty), \"chôdzky na zdokumentované predvolené nastavenia), alebo \"konfigurácia\" (odkazy prepínať predvolené nastavenia). ⚙️"
},
"separate_turn_on_commands": {
"description": "Použiť samostatné volania služby `light.turn_on` pre nastavenie teploty svetla a jasu (môže byť potrebné pre niektoré typy svetiel). 🔀"
@ -196,7 +196,7 @@
"description": "`entity_id` prepínača u ktorého sa majú svetlá o(d)značiť ako \"manuálne ovládané\". 📝"
},
"lights": {
"description": "entity_id svetiel, ak nie sú špecifikované, tak sú vybrané všetky svetlá prepínača. 💡"
"description": "subjekt_id(s) svietidiel, ak nie je špecifikované, všetky svetlá v prepínači sú vybrané. 💡"
}
},
"description": "Či označiť svetlo ako \"manuálne ovládané\"."

View file

@ -0,0 +1,75 @@
{
"options": {
"step": {
"init": {
"data": {
"prefer_rgb_color": "prefer_rgb_color: Ali v primeru možnosti raje uporabiti prilagoditev RGB barve kot barvno temperaturo luči. 🌈",
"transition_until_sleep": "transition_until_sleep: Če je omogočeno, bo Adaptive Lighting obravnaval nastavitve spanja kot minimalne vrednosti in bo po zahodu sonca prehajal na te vrednosti. 🌙",
"take_over_control": "take_over_control: Onemogoči Adaptive Lighting, če drug vir pokliče \"light.turn_on\", ko so luči prižgane in se prilagajajo. Opozorilo: to ob vsakem intervalu kliče \"homeassistant.update_entity\"! 🔒",
"detect_non_ha_changes": "„detect_non_ha_changes: Zazna in ustavi prilagoditve za spremembe stanja, ki niso posledica \"light.turn_on\". Zahteva omogočeno \"take_over_control\". 🕵️ Pozor: ⚠️ Nekatere luči lahko nepravilno poročajo, da so prižgane, kar lahko povzroči nepričakovano vklapljanje. Onemogočite to funkcijo, če naletite na takšne težave.",
"lights": "lights: Seznam entity_id-jev luči za nadzor (lahko je prazen). 🌟",
"min_brightness": "min_brightness: Odstotek najmanjše svetlosti. 💡",
"max_brightness": "max_brightness: Odstotek največeje svetlosti. 💡",
"min_color_temp": "min_color_temp: Najtoplejša barvna temperatura v Kelvinih. 🔥",
"max_color_temp": "max_color_temp: Najhladnejša barvna temperatura v kelvinih. ❄️",
"separate_turn_on_commands": "separate_turn_on_commands: Uporabi ločene klice \"light.turn_on\" za barvo in jakost, kar je potrebno za nekatere tipe luči. 🔀",
"skip_redundant_commands": "skip_redundant_commands: Preskoči pošiljanje prilagoditvenih ukazov, če je ciljano stanje že enako poznanemu stanju luči. Zmanjšuje omrežni promet in izboljšuje odzivnost prilagajanja v določenih situacijah. 📉 Onemogočite, če se fizična stanja luči ne ujemajo z zabeleženim stanjem v HA.",
"intercept": "intercept: Prestreza in prilagaja klice \"light.turn_on\" za takojšnjo prilagoditev barve in jakosti. 🏎️ Onemogočite za luči, ki ne podpirajo \"light.turn_on\" z barvo in svetlostjo.",
"multi_light_intercept": "multi_light_intercept: Prestreza in prilagaja klice \"light.turn_on\", ki ciljajo več luči. ➗⚠️ To lahko privede do razdelitve enega klica \"light.turn_on\" v več klicev, npr. ko so luči na različnih stikalih. Zahteva omogočeno \"intercept\".",
"include_config_in_attributes": "include_config_in_attributes: Ko je nastavljeno na \"true\", prikaže vse možnosti kot atribute stikala v Home Assistantu. 📝",
"only_once": "only_once: Prilagodi luči samo ob vklopu (true) ali pa jih še naprej prilagajaj (false). 🔄",
"adapt_only_on_bare_turn_on": "adapt_only_on_bare_turn_on: Ob začetnem vklopu luči. Če je nastavljeno na \"true\", AL prilagodi samo, če je \"light.turn_on\" klic brez podanih parametrov barve ali jakosti. ❌🌈 S tem se npr. prepreči prilagajanje pri aktivaciji scene. Če je \"false\", AL prilagodi ne glede na prisotnost barve ali jakosti v začetnih \"service_data\". Zahteva omogočeno \"take_over_control\". 🕵️"
},
"data_description": {
"sunrise_offset": "Prilagodite čas sončnega vzhoda z pozitivnim ali negativnim zamikom v sekundah. ⏰",
"send_split_delay": "Zamik (ms) med \"separate_turn_on_commands\" za luči, ki ne podpirajo hkratne nastavitve jakosti in barve. ⏲️",
"transition": "Trajanje prehoda pri spreminjanju luči, v sekundah. 🕑",
"interval": "Pogostost prilagajanja luči, v sekundah. 🔄",
"sleep_brightness": "Odstotek svetlosti luči v načinu spanja. 😴",
"sleep_rgb_or_color_temp": "V načinu spanja uporabi \"rgb_color\" ali \"color_temp\". 🌙",
"sleep_color_temp": "Barvna temperatura v načinu spanja (uporabljena, ko je \"sleep_rgb_or_color_temp\" nastavljena na \"color_temp\") v Kelvinih. 😴",
"sleep_transition": "Trajanje prehoda, ko se preklopi način spanja, v sekundah. 😴",
"sunrise_time": "Nastavi fiksni čas (HH:MM:SS) sončnega vzhoda. 🌅",
"min_sunrise_time": "Nastavi najzgodnejši navidezni sončni vzhod (HH:MM:SS), dovoljuje kasnejše vzhode. 🌅",
"sunset_time": "Nastavite fiksni čas (HH:MM:SS) za sončni zahod. 🌇",
"min_sunset_time": "Nastavite najzgodnejši navidezni čas sončnega zahoda (HH:MM:SS), dovoljuje kasnejše sončne zahode. 🌇",
"sunset_offset": "Prilagodite čas sončnega zahoda s pozitivnim ali negativnim zamikom v sekundah. ⏰",
"brightness_mode_time_dark": "(Prezrto, če je \"brightness_mode='default'\") Trajanje v sekundah za postopno povečanje ali zmanjšanje svetlosti pred/po sončnem vzhodu/zahodu. 📈📉",
"brightness_mode_time_light": "(Prezrto, če je \"brightness_mode='default'\") Trajanje v sekundah za postopno povečanje ali zmanjšanje svetlosti po/pred sončnem vzhodu/zahodu. 📈📉",
"autoreset_control_seconds": "Samodejno ponastavi ročni nadzor po določenem številu sekund. Nastavite na 0, da onemogočite. ⏲️",
"max_sunrise_time": "Nastavi najkasnejši virtualni sončni vzhod (HH:MM:SS), dovoljuje zgodnejše vzhode. 🌅",
"max_sunset_time": "Nastavite najpoznejši navidezni čas sončnega zahoda (HH:MM:SS), dovoljuje zgodnejše sončne zahode. 🌇",
"brightness_mode": "Način upravljanja svetlosti. Možne vrednosti so \"default\", \"linear\" in \"tanh\" (uporablja \"brightness_mode_time_dark\" in \"brightness_mode_time_light\"). 📈",
"initial_transition": "Trajanje prvega prehoda, ko se luči prižgejo (iz \"off\" v \"on\"), v sekundah. ⏲️",
"sleep_rgb_color": "RGB barva v načinu spanja (uporabljena, ko je \"sleep_rgb_or_color_temp\" nastavljeno na \"rgb_color\"). 🌈"
},
"title": "Nastavitve prilagodljive osvetlitve",
"description": "Konfigurirajte komponento Adaptive Lighting. Imena možnosti so usklajena z nastavitvami v YAML. Če ste ta vnos definirali v YAML, tukaj ne bodo prikazane nobene možnosti. Za interaktivne grafe, ki ponazarjajo učinke parametrov, obiščite to [spletno aplikacijo]({webapp_url}). Za dodatne podrobnosti glejte [uradno dokumentacijo]({docs_url})."
}
}
},
"config": {
"step": {
"user": {
"title": "Izberite ime za instanco Adaptive Lighting",
"description": "Vsaka instanca lahko vsebuje več luči!"
}
},
"abort": {
"already_configured": "Naprava je že konfigurirana"
}
},
"services": {
"change_switch_settings": {
"fields": {
"only_once": {
"description": "Prilagajaj luči samo kadar so prižgane (\"true\") ali konstantno jih prilagajaj (\"false\")"
},
"max_sunrise_time": {
"description": "Nastavite najpoznejši navidezni čas sončnega vzhoda (HH:MM:SS), dovoljuje zgodnejše sončne vzhode. 🌅"
}
}
}
},
"title": "Prilagodljiva osvetlitev"
}

View file

@ -40,7 +40,7 @@
"detect_non_ha_changes": "detect_non_ha_changes, Upptäcker alla ändringar större än 5% gjorda på ljuskällorna som inte kommer från HA. Kräver att 'take_over_control' är påslaget.(Kallar på 'homeassistant.update_entity' vid varje 'interval'!)",
"transition": "transition, i sekunder",
"multi_light_intercept": "multi_light_intercept: Fånga upp och anpassa \"light.turn_on\"-anrop som riktar sig mot flera lampor. ➗⚠️ Detta kan resultera i att ett enda `light.turn_on`-anrop delas upp i flera anrop, t.ex. när lamporna är kopplade till olika strömbrytare. Kräver att \"intercept\" är aktiverat.",
"adapt_only_on_bare_turn_on": "adapt_only_on_bare_turn_on: När lampor först tänds. Om satt till \"true\", anpassar AL endast om \"light.turn_on\" anropas utan att ange färg eller ljusstyrka. ❌🌈 Detta förhindrar t.ex. anpassning när en scen aktiveras. Om \"false\" anpassas AL oavsett förekomsten av färg eller ljusstyrka i den initiala \"service_data\". \"takeover_control\" måste vara aktiverat. 🕵️ ",
"adapt_only_on_bare_turn_on": "adapt_only_on_bare_turn_on: När lampor först tänds. Om satt till \"true\", anpassar AL endast om \"light.turn_on\" anropas utan att ange färg eller ljusstyrka. ❌🌈 Detta förhindrar t.ex. anpassning när en scen aktiveras. Om \"false\" anpassas AL oavsett förekomsten av färg eller ljusstyrka i den initiala \"service_data\". \"takeover_control\" måste vara aktiverat. 🕵️",
"skip_redundant_commands": "skip_redundant_commands: Hoppa över att skicka anpassningskommandon vars måltillstånd redan är lika med lampans kända tillstånd. Minimerar nätverkstrafik och förbättrar anpassningsförmågan i vissa situationer. 📉 Inaktivera om lampans tillstånd blir osynkroniserade med HA:s registrerade tillstånd.",
"intercept": "intercept: Fånga upp och anpassa `light.turn_on`-anrop för att möjliggöra omedelbar anpassning av färg och ljusstyrka. 🏎️ Inaktivera för lampor som inte stöder `light.turn_on` med färg och ljusstyrka.",
"transition_until_sleep": "transition_until_sleep: När aktiverat kommer Adaptive Lighting att behandla sömninställningarna som ett minimum och övergå till dessa värden efter solnedgången. 🌙",

View file

@ -0,0 +1,202 @@
{
"services": {
"set_manual_control": {
"description": "ஒரு ஒளி 'கைமுறையாக கட்டுப்படுத்தப்பட்டதா' என்பதைக் குறிக்கவும்.",
"fields": {
"entity_id": {
"description": "சுவிட்சின் `நிறுவனம்_ஐடி`, இதில் (அன்) ஒளியை` கைமுறையாக கட்டுப்படுத்தப்படுகிறது 'என்று குறிக்கவும். ."
},
"lights": {
"description": "விளக்குகளின் entity_id (கள்), குறிப்பிடப்படாவிட்டால், சுவிட்சில் உள்ள அனைத்து விளக்குகளும் தேர்ந்தெடுக்கப்படுகின்றன. ."
},
"manual_control": {
"description": "\"கையேடு_ கன்ட்ரோல்\" பட்டியலிலிருந்து ஒளியை சேர்க்க வேண்டுமா அல்லது அகற்ற வேண்டுமா அல்லது அகற்ற வேண்டுமா அல்லது அகற்ற வேண்டுமா? ."
}
}
},
"change_switch_settings": {
"fields": {
"sunrise_offset": {
"description": "விநாடிகளில் நேர்மறை அல்லது எதிர்மறை ஆஃப்செட் மூலம் சூரிய தோன்றுகை நேரத்தை சரிசெய்யவும். ."
},
"sunrise_time": {
"description": "சூரிய உதயத்திற்கு ஒரு நிலையான நேரத்தை (HH: MM: SS) அமைக்கவும். ."
},
"entity_id": {
"description": "சுவிட்சின் நிறுவன ஐடி. ."
},
"use_defaults": {
"description": "இந்த பணி அழைப்பில் குறிப்பிடப்படாத இயல்புநிலை மதிப்புகளை அமைக்கிறது. விருப்பங்கள்: \"நடப்பு\" (இயல்புநிலை, தற்போதைய மதிப்புகளைத் தக்க வைத்துக் கொள்கிறது), \"தொழிற்சாலை\" (ஆவணப்படுத்தப்பட்ட இயல்புநிலைகளுக்கு மீட்டமைக்கிறது) அல்லது \"உள்ளமைவு\" (கட்டமைப்பு இயல்புநிலைகளை மாற்றுவதற்கு மாற்றுகிறது). ."
},
"include_config_in_attributes": {
"description": "`உண்மை` என அமைக்கப்பட்டிருக்கும் போது வீட்டு உதவியாளரின் சுவிட்சில் உள்ள அனைத்து விருப்பங்களையும் பண்புகளாகக் காட்டுங்கள். ."
},
"turn_on_lights": {
"description": "தற்போது முடக்கப்பட்ட விளக்குகளை இயக்க வேண்டுமா. ."
},
"initial_transition": {
"description": "விளக்குகள் `ஆஃப்` முதல்` ஆன் `வரை நொடிகளில் மாறும் போது முதல் மாற்றத்தின் காலம். ."
},
"sleep_transition": {
"description": "\"தூக்க பயன்முறை\" நொடிகளில் மாற்றப்படும்போது மாற்றத்தின் காலம். ."
},
"max_brightness": {
"description": "அதிகபட்ச ஒளி விழுக்காடு. ."
},
"max_color_temp": {
"description": "கெல்வினில் குளிரான வண்ண வெப்பநிலை. ."
},
"min_brightness": {
"description": "குறைந்தபட்ச ஒளி விழுக்காடு. ."
},
"min_color_temp": {
"description": "கெல்வினில் வெப்பமான வண்ண வெப்பநிலை. ."
},
"only_once": {
"description": "விளக்குகள் இயக்கப்படும்போது மட்டுமே (`உண்மை`) மாற்றியமைக்கும்போது அல்லது அவற்றைத் தழுவிக்கொள்ளுங்கள் (` பொய்`). ."
},
"prefer_rgb_color": {
"description": "முடிந்தவரை ஒளி வண்ண வெப்பநிலையை விட RGB வண்ண சரிசெய்தலை விரும்பலாமா. ."
},
"separate_turn_on_commands": {
"description": "சில ஒளி வகைகளுக்கு தேவைப்படும் வண்ணம் மற்றும் பிரகாசத்திற்கான தனித்தனி `லைட்.டர்ன்_ஓஎன்` அழைப்புகளைப் பயன்படுத்தவும். ."
},
"send_split_delay": {
"description": "ஒரே நேரத்தில் ஒளி மற்றும் வண்ண அமைப்பை ஆதரிக்காத விளக்குகளுக்கு `தனி_டர்ன்_ஆன்_காமண்ட்ச்` இடையே நேரந்தவறுகை (எம்.எச்). ."
},
"sleep_brightness": {
"description": "தூக்க பயன்முறையில் விளக்குகளின் ஒளி விழுக்காடு. ."
},
"sleep_rgb_or_color_temp": {
"description": "தூக்க பயன்முறையில் `\" rgb_color \"` அல்லது `\" Color_Temp \"key ஐப் பயன்படுத்தவும். ."
},
"sleep_rgb_color": {
"description": "தூக்க பயன்முறையில் RGB வண்ணம் (`SLEEP_RGB_OR_COLOR_TEMP`\" RGB_COLOR \"ஆக இருக்கும்போது பயன்படுத்தப்படுகிறது). ."
},
"sleep_color_temp": {
"description": "ச்லீப் பயன்முறையில் வண்ண வெப்பநிலை (கெல்வினில் `SLEEP_RGB_OR_COLOR_TEMP` என்பது` color_temp` ஆக இருக்கும்போது பயன்படுத்தப்படுகிறது). ."
},
"sunset_offset": {
"description": "வினாடிகளில் நேர்மறை அல்லது எதிர்மறை ஆஃப்செட் மூலம் சூரிய மறைவு நேரத்தை சரிசெய்யவும். ."
},
"sunset_time": {
"description": "சூரிய அச்தமனத்திற்கு ஒரு நிலையான நேரத்தை (HH: MM: SS) அமைக்கவும். ."
},
"max_sunrise_time": {
"description": "ஆரம்பகால சூரிய உதயத்தை அனுமதிக்கும் அண்மைக் கால மெய்நிகர் சூரிய தோன்றுகை நேரத்தை (HH: MM: SS) அமைக்கவும். ."
},
"min_sunset_time": {
"description": "ஆரம்பகால மெய்நிகர் சூரிய மறைவு நேரத்தை (HH: MM: SS) அமைக்கவும், பின்னர் சூரிய அச்தமனங்களை அனுமதிக்கிறது. ."
},
"take_over_control": {
"description": "விளக்குகள் இயக்கத்தில் இருக்கும்போது மற்றொரு சான்று `லைட்.டர்ன்_ஒன்` என்று அழைத்தால் தகவமைப்பு விளக்குகளை முடக்கு. இது `ஓமாசிச்டன்ட்.பிடேட்_என்டிட்டி` ஒவ்வொரு` இடைவெளியையும் 'என்று அழைக்கிறது என்பதை நினைவில் கொள்க! ."
},
"detect_non_ha_changes": {
"description": "`விளக்கு அல்லாத. டர்ன்_ஓஎன்` மாநில மாற்றங்களுக்கான தழுவல்களைக் கண்டறிந்து நிறுத்துகிறது. `Take_over_control` இயக்கப்பட்டது. 🕵œ எச்சரிக்கை: ⚠œ சில விளக்குகள் ஒரு 'ஆன்' நிலையை பொய்யாகக் குறிக்கக்கூடும், இதனால் விளக்குகள் எதிர்பாராத விதமாக இயக்கப்படலாம். இதுபோன்ற சிக்கல்களை நீங்கள் சந்தித்தால் இந்த அம்சத்தை முடக்கு."
},
"transition": {
"description": "விளக்குகள் மாறும்போது, நொடிகளில் மாற்றத்தின் காலம். ."
},
"adapt_delay": {
"description": "லைட் டர்ன் மற்றும் தகவமைப்பு விளக்குகள் இடையே காத்திருப்பு நேரம் (விநாடிகள்) மாற்றங்களைப் பயன்படுத்துகிறது. ஒளிரும் தவிர்க்க உதவலாம். ."
},
"autoreset_control_seconds": {
"description": "பல விநாடிகளுக்குப் பிறகு தானாகவே கையேடு கட்டுப்பாட்டை மீட்டமைக்கவும். முடக்க 0 என அமைக்கவும். ."
}
},
"description": "சுவிட்சில் நீங்கள் விரும்பும் எந்த அமைப்புகளையும் மாற்றவும். இங்குள்ள அனைத்து விருப்பங்களும் கட்டமைப்பு ஓட்டத்தில் உள்ளதைப் போலவே இருக்கும்."
},
"apply": {
"description": "தற்போதைய தகவமைப்பு லைட்டிங் அமைப்புகளை விளக்குகளுக்கு பயன்படுத்துகிறது.",
"fields": {
"entity_id": {
"description": "விண்ணப்பிக்க அமைப்புகளுடன் சுவிட்சின் `ENTITY_ID`. ."
},
"lights": {
"description": "அமைப்புகளைப் பயன்படுத்த ஒரு ஒளி (அல்லது விளக்குகளின் பட்டியல்). ."
},
"transition": {
"description": "விளக்குகள் மாறும்போது, நொடிகளில் மாற்றத்தின் காலம். ."
},
"adapt_brightness": {
"description": "ஒளியின் பிரகாசத்தை மாற்றியமைக்க வேண்டுமா. ."
},
"adapt_color": {
"description": "துணை விளக்குகளில் வண்ணத்தை மாற்றியமைக்க வேண்டுமா. ."
},
"prefer_rgb_color": {
"description": "முடிந்தவரை ஒளி வண்ண வெப்பநிலையை விட RGB வண்ண சரிசெய்தலை விரும்பலாமா. ."
},
"turn_on_lights": {
"description": "தற்போது முடக்கப்பட்ட விளக்குகளை இயக்க வேண்டுமா. ."
}
}
}
},
"title": "தகவமைப்பு விளக்குகள்",
"config": {
"step": {
"user": {
"title": "தகவமைப்பு விளக்கு உதாரணத்திற்கு ஒரு பெயரைத் தேர்வுசெய்க",
"description": "ஒவ்வொரு நிகழ்விலும் பல விளக்குகள் இருக்கலாம்!"
}
},
"abort": {
"already_configured": "இந்த சாதனம் ஏற்கனவே கட்டமைக்கப்பட்டுள்ளது"
}
},
"options": {
"step": {
"init": {
"title": "தகவமைப்பு விளக்கு விருப்பங்கள்",
"description": "தகவமைப்பு விளக்கு கூறுகளை உள்ளமைக்கவும். விருப்பப் பெயர்கள் YAML அமைப்புகளுடன் சீரமைக்கப்படுகின்றன. இந்த உள்ளீட்டை நீங்கள் YAML இல் வரையறுத்திருந்தால், இங்கே எந்த விருப்பங்களும் தோன்றாது. அளவுரு விளைவுகளை நிரூபிக்கும் ஊடாடும் வரைபடங்களுக்கு, [இந்த வலை பயன்பாடு]({webapp_url}) ஐப் பார்வையிடவும். மேலும் விவரங்களுக்கு, [அதிகாரப்பூர்வ ஆவணங்கள்]({docs_url}) ஐப் பார்க்கவும்.",
"data": {
"lights": "விளக்குகள்: கட்டுப்படுத்தப்பட வேண்டிய ஒளி நிறுவனம்_டுகளின் பட்டியல் (காலியாக இருக்கலாம்). .",
"min_brightness": "min_brightness: குறைந்தபட்ச ஒளி விழுக்காடு. .",
"max_brightness": "அதிகபட்ச பிரகாசம்: அதிகபட்ச ஒளி விழுக்காடு. .",
"min_color_temp": "min_color_temp: கெல்வினில் வெப்பமான வண்ண வெப்பநிலை. .",
"max_color_temp": "MAX_COLOR_TEMP: கெல்வினில் குளிரான வண்ண வெப்பநிலை. .",
"prefer_rgb_color": "bey_rgb_color: முடிந்தவரை ஒளி வண்ண வெப்பநிலையை விட RGB வண்ண சரிசெய்தலை விரும்பலாமா. .",
"transition_until_sleep": "Transition_until_sleep: இயக்கப்பட்டால், தகவமைப்பு விளக்குகள் தூக்க அமைப்புகளை குறைந்தபட்சமாகக் கருதும், சூரிய அச்தமனத்திற்குப் பிறகு இந்த மதிப்புகளுக்கு மாறும். .",
"take_over_control": "Take_over_control: விளக்குகள் இயக்கத்தில் இருக்கும்போது மற்றொரு சான்று `லைட்.டர்ன்_ஓஎன்` என்று அழைத்தால் தகவமைப்பு விளக்குகளை முடக்கு. இது `ஓமாசிச்டன்ட்.பிடேட்_என்டிட்டி` ஒவ்வொரு` இடைவெளியையும் 'என்று அழைக்கிறது என்பதை நினைவில் கொள்க! .",
"detect_non_ha_changes": "கண்டறிதல்_நான்_ஆ_சேஞ்ச்ச்: `விளக்கு அல்லாத. டர்ன்_ஓஎன்` மாநில மாற்றங்களுக்கான தழுவல்களைக் கண்டறிந்து நிறுத்துகிறது. `Take_over_control` இயக்கப்பட்டது. 🕵œ எச்சரிக்கை: ⚠œ சில விளக்குகள் ஒரு 'ஆன்' நிலையை பொய்யாகக் குறிக்கக்கூடும், இதனால் விளக்குகள் எதிர்பாராத விதமாக இயக்கப்படலாம். இதுபோன்ற சிக்கல்களை நீங்கள் சந்தித்தால் இந்த அம்சத்தை முடக்கு.",
"only_once": "மட்டும்_இன்: விளக்குகள் இயக்கப்படும்போது மட்டுமே (`உண்மை`) மாற்றியமைக்கும்போது அல்லது அவற்றைத் தழுவிக்கொள்ளுங்கள் (` தவறு`). .",
"adapt_only_on_bare_turn_on": "சரிசெய்_only_on_bare_turn_on: ஆரம்பத்தில் விளக்குகளை இயக்கும்போது. `உண்மை` என அமைக்கப்பட்டால், வண்ணம் அல்லது பிரகாசத்தைக் குறிப்பிடாமல்` லைட்.டர்ன்_ஓஎன்` செயல்படுத்தப்பட்டால் மட்டுமே அல் மாற்றியமைக்கிறது. ❌🌈 இது எ.கா., ஒரு காட்சியைச் செயல்படுத்தும்போது தழுவலைத் தடுக்கிறது. `தவறு` என்றால், ஆரம்ப` சேவை_டா` இல் நிறம் அல்லது ஒளி இருப்பதைப் பொருட்படுத்தாமல் AL மாற்றியமைக்கிறது. `Take_over_control` இயக்கப்பட்டது. . 🕵️",
"separate_turn_on_commands": "தனித்தனி_டர்ன்_ஆன்_காமண்ட்ச்: சில ஒளி வகைகளுக்கு தேவைப்படும் வண்ணம் மற்றும் பிரகாசத்திற்கான தனித்தனி `லைட்.டர்ன்_ஓஎன்` அழைப்புகளைப் பயன்படுத்தவும். .",
"skip_redundant_commands": "Skip_redundant_commands: தழுவல் கட்டளைகளை அனுப்புவதைத் தவிர்க்கவும், அதன் இலக்கு நிலை ஏற்கனவே ஒளியின் அறியப்பட்ட நிலைக்கு சமம். பிணையம் போக்குவரத்தை குறைக்கிறது மற்றும் சில சூழ்நிலைகளில் தழுவல் மறுமொழியை மேம்படுத்துகிறது. ஆ இன் பதிவு செய்யப்பட்ட நிலையுடன் இயற்பியல் ஒளி நிலைகள் ஒத்திசைவிலிருந்து வெளியேறினால் அது காணக்கூடியது.",
"intercept": "இடைமறிப்பு: உடனடி வண்ணம் மற்றும் பிரகாசமான தழுவலை செயல்படுத்த `ஒளி. Color வண்ணம் மற்றும் பிரகாசத்துடன் `ஒளி.",
"multi_light_intercept": "Mulli_light_intect: பல விளக்குகளை குறிவைக்கும் `light.turn_on` அழைப்புகளை இடைமறிக்கவும் மாற்றவும். ➗⚠œ இது ஒரு `லைட்.டர்ன்_ஒன்` அழைப்பை பல அழைப்புகளாக பிரிக்கக்கூடும், எ.கா., விளக்குகள் வெவ்வேறு சுவிட்சுகளில் இருக்கும்போது. இயக்கப்பட வேண்டும் `இடைமறிப்பு` தேவை.",
"include_config_in_attributes": "அடங்கும்_கான்ஃபிக்_இன்_அட்ரிபியூட்: `உண்மை` என அமைக்கப்பட்டிருக்கும் போது வீட்டு உதவியாளரின் சுவிட்சில் உள்ள பண்புகளாக அனைத்து விருப்பங்களையும் காட்டுங்கள். ."
},
"data_description": {
"interval": "விளக்குகளை மாற்றியமைக்க அதிர்வெண், நொடிகளில். .",
"transition": "விளக்குகள் மாறும்போது, நொடிகளில் மாற்றத்தின் காலம். .",
"initial_transition": "விளக்குகள் `ஆஃப்` முதல்` ஆன் `வரை நொடிகளில் மாறும் போது முதல் மாற்றத்தின் காலம். .",
"sleep_brightness": "தூக்க பயன்முறையில் விளக்குகளின் ஒளி விழுக்காடு. .",
"sleep_rgb_or_color_temp": "தூக்க பயன்முறையில் `\" rgb_color \"` அல்லது `\" Color_Temp \"key ஐப் பயன்படுத்தவும். .",
"sleep_color_temp": "ச்லீப் பயன்முறையில் வண்ண வெப்பநிலை (கெல்வினில் `SLEEP_RGB_OR_COLOR_TEMP` என்பது` color_temp` ஆக இருக்கும்போது பயன்படுத்தப்படுகிறது). .",
"sleep_rgb_color": "தூக்க பயன்முறையில் RGB வண்ணம் (`SLEEP_RGB_OR_COLOR_TEMP`\" RGB_COLOR \"ஆக இருக்கும்போது பயன்படுத்தப்படுகிறது). .",
"sleep_transition": "\"தூக்க பயன்முறை\" நொடிகளில் மாற்றப்படும்போது மாற்றத்தின் காலம். .",
"sunrise_time": "சூரிய உதயத்திற்கு ஒரு நிலையான நேரத்தை (HH: MM: SS) அமைக்கவும். .",
"min_sunrise_time": "ஆரம்பகால மெய்நிகர் சூரிய உதய நேரத்தை (HH: MM: SS) அமைக்கவும், பின்னர் சூரிய உதயங்களை அனுமதிக்கிறது. .",
"max_sunrise_time": "ஆரம்பகால சூரிய உதயத்தை அனுமதிக்கும் அண்மைக் கால மெய்நிகர் சூரிய தோன்றுகை நேரத்தை (HH: MM: SS) அமைக்கவும். .",
"sunrise_offset": "விநாடிகளில் நேர்மறை அல்லது எதிர்மறை ஆஃப்செட் மூலம் சூரிய தோன்றுகை நேரத்தை சரிசெய்யவும். .",
"sunset_time": "சூரிய அச்தமனத்திற்கு ஒரு நிலையான நேரத்தை (HH: MM: SS) அமைக்கவும். .",
"min_sunset_time": "ஆரம்பகால மெய்நிகர் சூரிய மறைவு நேரத்தை (HH: MM: SS) அமைக்கவும், பின்னர் சூரிய அச்தமனங்களை அனுமதிக்கிறது. .",
"max_sunset_time": "முந்தைய சூரிய அச்தமனங்களை அனுமதிக்கும் அண்மைக் கால மெய்நிகர் சன்செட் நேரத்தை (HH: MM: SS) அமைக்கவும். .",
"sunset_offset": "விநாடிகளில் நேர்மறை அல்லது எதிர்மறை ஆஃப்செட் மூலம் சூரிய மறைவு நேரத்தை சரிசெய்யவும். .",
"send_split_delay": "ஒரே நேரத்தில் ஒளி மற்றும் வண்ண அமைப்பை ஆதரிக்காத விளக்குகளுக்கு `தனி_டர்ன்_ஆன்_காமண்ட்ச்` இடையே நேரந்தவறுகை (எம்.எச்). .",
"adapt_delay": "லைட் டர்ன் மற்றும் தகவமைப்பு விளக்குகள் இடையே காத்திருப்பு நேரம் (விநாடிகள்) மாற்றங்களைப் பயன்படுத்துகிறது. ஒளிரும் தவிர்க்க உதவலாம். .",
"brightness_mode": "பயன்படுத்த பிரகாசமான முறை. சாத்தியமான மதிப்புகள் `இயல்புநிலை`,` லீனியர்`, மற்றும் `டான்` (` பிரகாசம்_மோட்_ நேரம்_டார்க்` மற்றும் `பிரகாசம்_மோட்_மட்_லிட்` ஆகியவற்றைப் பயன்படுத்துகின்றன). .",
"brightness_mode_time_dark": ". .",
"brightness_mode_time_light": ". ..",
"autoreset_control_seconds": "பல விநாடிகளுக்குப் பிறகு தானாகவே கையேடு கட்டுப்பாட்டை மீட்டமைக்கவும். முடக்க 0 என அமைக்கவும். ."
}
}
},
"error": {
"option_error": "தவறான விருப்பம்",
"entity_missing": "ஒன்று அல்லது அதற்கு மேற்பட்ட தேர்ந்தெடுக்கப்பட்ட ஒளி நிறுவனங்கள் வீட்டு உதவியாளரிடமிருந்து காணவில்லை"
}
}
}

View file

@ -0,0 +1,202 @@
{
"title": "Akıllı Aydınlatma",
"options": {
"step": {
"init": {
"title": "Akıllı Aydınlatma seçenekleri",
"data": {
"adapt_only_on_bare_turn_on": "Işıklar açıldığında geçerlidir. `true` olarak ayarlanırsa, eklenti yalnızca `light.turn_on` işlemi renk veya parlaklık belirtilmeden çağrıldığında uyarlama yapar (örneğin sahne etkinleştirmelerinde uyarlama yapılmaz). ❌🌈\n`false` olarak ayarlanırsa, renk veya parlaklık belirtilmiş olsa bile uyarlama yapılır. Bu ayarın çalışması için `take_over_control` etkin olmalıdır. 🕵️",
"detect_non_ha_changes": "`detect_non_ha_changes`: `light.turn_on` dışındaki durum değişikliklerini algılar ve uyarlamayı durdurur. Bu ayarın çalışması için `take_over_control` etkin olmalıdır. 🕵️\nDikkat: ⚠️ Bazı ışıklar yanlışlıkla “açık” durumunu bildirebilir, bu da ışıkların beklenmedik şekilde açılmasına yol açabilir. Böyle bir durumla karşılaşırsanız bu özelliği devre dışı bırakın.",
"include_config_in_attributes": "`include_config_in_attributes`: `true` olarak ayarlandığında, tüm seçenekleri Home Assistant’ta anahtarın attribute’ları olarak gösterir. 📝",
"intercept": "`intercept`: `light.turn_on` çağrılarını yakalar ve renk ile parlaklığın anında uyarlanmasını sağlar. 🏎️ Renk ve parlaklığı desteklemeyen ışıklar için devre dışı bırakın.",
"lights": "`lights`: Kontrol edilecek ışıkların entity_id listesi (boş bırakılabilir). 🌟",
"max_brightness": "`max_brightness`: Maksimum parlaklık yüzdesi. 💡",
"max_color_temp": "`max_color_temp`: En düşük renk sıcaklığı (Kelvin cinsinden). ❄️",
"min_brightness": "min_brightness: Minimum parlaklık yüzdesi.💡",
"min_color_temp": "`min_color_temp`: En yüksek (sıcak) renk sıcaklığı (Kelvin cinsinden). 🔥",
"multi_light_intercept": "`multi_light_intercept`: Birden fazla ışığı hedefleyen `light.turn_on` çağrılarını yakalar ve uyarlama yapar. ➗⚠️ Bu, örneğin ışıklar farklı anahtarlardaysa tek bir `light.turn_on` çağrısının birden fazla çağrıya bölünmesine yol açabilir. `intercept` etkin olmalıdır.",
"only_once": "`only_once`: Işıkları yalnızca açıldıklarında mı uyarlasın (`true`), yoksa sürekli uyarlamaya devam mı etsin (`false`). 🔄",
"prefer_rgb_color": "`prefer_rgb_color`: Mümkünse ışık renk sıcaklığı yerine RGB renk ayarını tercih edip etmeyeceğini belirler. 🌈",
"separate_turn_on_commands": "`separate_turn_on_commands`: Renk ve parlaklık için ayrı `light.turn_on` çağrıları kullanır; bazı ışık türleri için gereklidir. 🔀",
"skip_redundant_commands": "`skip_redundant_commands`: Hedef durumu ışığın bilinen durumu ile aynı olan uyarlama komutlarını atlar. Ağ trafiğini azaltır ve bazı durumlarda uyarlamanın yanıt hızını artırır. 📉 \nFiziksel ışık durumları HA’daki kaydedilen durumla senkronize değilse devre dışı bırakın.",
"take_over_control": "`take_over_control`: Işıklar açıkken ve uyarlanırken başka bir kaynaktan `light.turn_on` çağrılırsa Adaptive Lighting’i devre dışı bırakır. Dikkat: Bu işlem her `interval` süresinde `homeassistant.update_entity` çağrısı yapar! 🔒",
"transition_until_sleep": "`transition_until_sleep`: Etkinleştirildiğinde, Adaptive Lighting uyku ayarlarını minimum değer olarak kabul eder ve gün batımından sonra bu değerlere geçiş yapar. 🌙"
},
"data_description": {
"sunrise_offset": "Gün doğumu saatini, saniye cinsinden pozitif veya negatif bir kaydırma ile ayarlayın. ⏰",
"sunset_offset": "Gün batımı saatini, saniye cinsinden pozitif veya negatif bir kaydırma ile ayarlayın. ⏰",
"autoreset_control_seconds": "Manuel kontrolü belirtilen saniye sonunda otomatik olarak sıfırlar. Devre dışı bırakmak için 0 olarak ayarlayın. ⏲️",
"brightness_mode": "Kullanılacak parlaklık modunu belirtir. Olası değerler: `default`, `linear` ve `tanh` (`brightness_mode_time_dark` ve `brightness_mode_time_light` ayarlarını kullanır). 📈",
"sleep_brightness": "Uyku modundayken ışıkların parlaklık yüzdesi 😴",
"sleep_color_temp": "Uyku modunda renk sıcaklığı ( `sleep_rgb_or_color_temp` `color_temp` olarak ayarlandığında kullanılır) Kelvin cinsinden. 😴",
"send_split_delay": "Parlaklık ve renk ayarını aynı anda desteklemeyen ışıklar için `separate_turn_on_commands` arasındaki gecikme (ms). ⏲️",
"initial_transition": "Işıklar `off` durumundan `on` durumuna geçerken ilk geçişin süresi (saniye cinsinden). ⏲️",
"transition": "Işıklar değişirken geçiş süresi (saniye cinsinden). 🕑",
"sleep_transition": "“Uyku modu” açılıp kapatıldığında geçiş süresi (saniye cinsinden). 😴",
"interval": "Işıkların uyarlanma sıklığı (saniye cinsinden). 🔄",
"brightness_mode_time_light": "(`brightness_mode='default'` ise göz ardı edilir) Gün doğumu/gün batımı öncesi/sonrası parlaklığı kademeli olarak artırma/azaltma süresi (saniye cinsinden). 📈📉",
"brightness_mode_time_dark": "(`brightness_mode='default'` ise göz ardı edilir) Gün doğumu/gün batımı öncesi/sonrası parlaklığı kademeli olarak artırma/azaltma süresi (saniye cinsinden). 📈📉",
"sleep_rgb_color": "Uyku modunda RGB renk ( `sleep_rgb_or_color_temp` \"rgb_color\" olarak ayarlandığında kullanılır). 🌈",
"sunrise_time": "Gün doğumu için sabit bir saat (SS:DD:YY) belirleyin. 🌅",
"sunset_time": "Gün batımı için sabit bir saat (SS:DD:YY) belirleyin. 🌇",
"min_sunrise_time": "En erken sanal gün doğumu saatini (SS:DD:YY) belirleyin; daha geç gün doğumlarına izin verir. 🌅",
"min_sunset_time": "En erken sanal gün batımı saatini (SS:DD:YY) belirleyin; daha geç gün batımlarına izin verir. 🌇",
"max_sunrise_time": "En geç sanal gün doğumu saatini (SS:DD:YY) belirleyin; daha erken gün doğumlarına izin verir. 🌅",
"max_sunset_time": "En geç sanal gün batımı saatini (SS:DD:YY) belirleyin; daha erken gün batımlarına izin verir. 🌇",
"sleep_rgb_or_color_temp": "Uyku modunda `\"rgb_color\"` veya `\"color_temp\"` kullanın. 🌙",
"adapt_delay": "Işık açıldıktan sonra Adaptive Lighting’in değişiklikleri uygulamasına kadar bekleme süresi (saniye cinsinden). Titremeyi önlemeye yardımcı olabilir. ⏲️"
},
"description": "Bir Adaptive Lighting bileşenini yapılandırın. Seçenek adları YAML ayarlarıyla uyumludur. Eğer bu girdiyi YAML’da tanımladıysanız, burada seçenekler görünmez. \nParametrelerin etkilerini gösteren etkileşimli grafikler için [bu web uygulamasını]({webapp_url}) ziyaret edebilirsiniz. Daha fazla bilgi için [resmi dokümantasyona]({docs_url}) bakın."
}
},
"error": {
"option_error": "Geçersiz seçenek",
"entity_missing": "Seçilen bir veya birden fazla ışık entity’si Home Assistant’ta bulunamadı."
}
},
"services": {
"change_switch_settings": {
"fields": {
"only_once": {
"description": "Işıkları yalnızca açıkken (`true`) uyarla, veya sürekli olarak uyarlamaya devam et (`false`).🔄"
},
"sunrise_offset": {
"description": "Gün doğumu saatini, saniye cinsinden pozitif veya negatif bir kaydırma ile ayarlayın. ⏰"
},
"sunset_offset": {
"description": "Gün batımı saatini, saniye cinsinden pozitif veya negatif bir kaydırma ile ayarlayın. ⏰"
},
"autoreset_control_seconds": {
"description": "Manuel kontrolü belirtilen saniye sonunda otomatik olarak sıfırlar. Devre dışı bırakmak için 0 olarak ayarlayın. ⏲️"
},
"sleep_brightness": {
"description": "Uyku modundayken ışıkların parlaklık yüzdesi 😴"
},
"max_color_temp": {
"description": "Kelvin cinsinden en düşük renk sıcaklığı. ❄️"
},
"sleep_color_temp": {
"description": "Uyku modunda renk sıcaklığı ( `sleep_rgb_or_color_temp` `color_temp` olarak ayarlandığında kullanılır) Kelvin cinsinden. 😴"
},
"send_split_delay": {
"description": "Parlaklık ve renk ayarını aynı anda desteklemeyen ışıklar için `separate_turn_on_commands` arasındaki gecikme (ms). ⏲️"
},
"detect_non_ha_changes": {
"description": "`light.turn_on` dışındaki durum değişikliklerini algılar ve uyarlamayı durdurur. Bu ayarın çalışması için `take_over_control` etkin olmalıdır. 🕵️ \nDikkat: ⚠️ Bazı ışıklar yanlışlıkla “açık” durumunu bildirebilir, bu da ışıkların beklenmedik şekilde açılmasına neden olabilir. Böyle bir durumda bu özelliği devre dışı bırakın."
},
"take_over_control": {
"description": "Işıklar açıkken ve uyarlanırken başka bir kaynaktan `light.turn_on` çağrılırsa Adaptive Lighting’i devre dışı bırakır. Dikkat: Bu işlem her `interval` süresinde `homeassistant.update_entity` çağrısı yapar! 🔒"
},
"initial_transition": {
"description": "Işıklar `off` durumundan `on` durumuna geçerken ilk geçişin süresi (saniye cinsinden). ⏲️"
},
"transition": {
"description": "Işıklar değişirken geçiş süresi (saniye cinsinden). 🕑"
},
"sleep_transition": {
"description": "“Uyku modu” açılıp kapatıldığında geçiş süresi (saniye cinsinden). 😴"
},
"entity_id": {
"description": "Anahtarın Entity ID’si. 📝"
},
"max_brightness": {
"description": "Maksimum parlaklık yüzdesi.💡"
},
"min_brightness": {
"description": "Minimum parlaklık yüzdesi.💡"
},
"sleep_rgb_color": {
"description": "Uyku modunda RGB renk ( `sleep_rgb_or_color_temp` \"rgb_color\" olarak ayarlandığında kullanılır). 🌈"
},
"sunrise_time": {
"description": "Gün doğumu için sabit bir saat (SS:DD:YY) belirleyin. 🌅"
},
"sunset_time": {
"description": "Gün batımı için sabit bir saat (SS:DD:YY) belirleyin. 🌇"
},
"use_defaults": {
"description": "Bu servis çağrısında belirtilmeyen varsayılan değerleri ayarlar. Seçenekler: \n- `current` (varsayılan, mevcut değerleri korur) \n- `factory` (belgelendirilmiş varsayılanlara sıfırlar) \n- `configuration` (anahtar yapılandırma varsayılanlarına döner) ⚙️"
},
"min_sunset_time": {
"description": "En erken sanal gün batımı saatini (SS:DD:YY) belirleyin; daha geç gün batımlarına izin verir. 🌇"
},
"max_sunrise_time": {
"description": "En geç sanal gün doğumu saatini (SS:DD:YY) belirleyin; daha erken gün doğumlarına izin verir. 🌅"
},
"include_config_in_attributes": {
"description": "`true` olarak ayarlandığında, tüm seçenekleri Home Assistant’ta anahtarın attribute’ları olarak gösterir. 📝"
},
"sleep_rgb_or_color_temp": {
"description": "Uyku modunda `\"rgb_color\"` veya `\"color_temp\"` kullanın. 🌙"
},
"separate_turn_on_commands": {
"description": "Renk ve parlaklık için ayrı `light.turn_on` çağrıları kullanın; bazı ışık türleri için gereklidir. 🔀"
},
"min_color_temp": {
"description": "En yüksek (sıcak) renk sıcaklığı (Kelvin cinsinden). 🔥"
},
"prefer_rgb_color": {
"description": "Mümkün olduğunda ışık renk sıcaklığı yerine RGB renk ayarını tercih edip etmeyeceğini belirler. 🌈"
},
"turn_on_lights": {
"description": "Şu anda kapalı olan ışıkların açılıp açılmayacağını belirler. 🔆"
},
"adapt_delay": {
"description": "Işık açıldıktan sonra Adaptive Lighting’in değişiklikleri uygulamasına kadar bekleme süresi (saniye cinsinden). Titremeyi önlemeye yardımcı olabilir. ⏲️"
}
},
"description": "Anahtardaki tüm ayarları dilediğiniz gibi değiştirebilirsiniz. Buradaki seçeneklerin hepsi, yapılandırma akışındakilerle aynıdır."
},
"apply": {
"fields": {
"lights": {
"description": "Ayarları bir veya birden fazla ışığa uygula.💡"
},
"transition": {
"description": "Işıklar değişirken geçiş süresi (saniye cinsinden). 🕑"
},
"entity_id": {
"description": "Uygulanacak ayarların bulunduğu anahtarın `entity_id`’si. 📝"
},
"adapt_brightness": {
"description": "Işığın parlaklığının uyarlanıp uyarlanmayacağını belirler. 🌞"
},
"adapt_color": {
"description": "Destekleyen ışıklarda rengin uyarlanıp uyarlanmayacağını belirler. 🌈"
},
"prefer_rgb_color": {
"description": "Mümkün olduğunda ışık renk sıcaklığı yerine RGB renk ayarını tercih edip etmeyeceğini belirler. 🌈"
},
"turn_on_lights": {
"description": "Şu anda kapalı olan ışıkların açılıp açılmayacağını belirler. 🔆"
}
},
"description": "Şu anki Akıllı Işıklandırma ayarlarını ışıklara uygular."
},
"set_manual_control": {
"fields": {
"lights": {
"description": "Işıkların entity_id(leri). Belirtilmezse, anahtardaki tüm ışıklar seçilir. 💡"
},
"entity_id": {
"description": "Işığın “manuel olarak kontrol edildiğini” işaretlemek veya kaldırmak için kullanılacak anahtarın `entity_id`’si. 📝"
},
"manual_control": {
"description": "Işığı “manuel kontrol” listesinden eklemek (`true`) veya çıkarmak (`false`) için kullanılır. 🔒"
}
},
"description": "Bir ışığın 'manuel olarak kontrol' edilip edilmediğini işaretleyin."
}
},
"config": {
"step": {
"user": {
"title": "Akıllı ışıklandırma örneği için bir ad seçin.",
"description": "Her örnek birden fazla ışık içerebilir!"
}
},
"abort": {
"already_configured": "Bu cihaz zaten ayarlanmış."
}
}
}

View file

@ -39,8 +39,36 @@
"take_over_control": "take_over_control: Якщо що-небудь, окрім Адаптивного освітлення, викликає 'light.turn_on', коли світло вже увімкнено, чи адаптувати освітлення допоки світло (або перемикач) перемкнеться (off -> on).",
"detect_non_ha_changes": "detect_non_ha_changes: виявляти всі зміни >10% до освітлення (включаючи ті, що зроблені поза HA), вимагає, щоб 'take_over_control' був включений (виклик 'homeassistant.update_entity' кожного оновлення 'interval'!)",
"transition": "Час переходу, який застосовується до освітлення (секунди)",
"adapt_only_on_bare_turn_on": "adapt_only_on_bare_turn_on: Коли спочатку вмикається світло. Якщо `true`, Адаптивне Освітлення адаптується лише якщо `light.turn_on` було викликано без вказування кольору чи яскравості. ❌🌈 Це в тому числі запобігає адаптації, коли активується сцена. Якщо `false`, Адаптивне Освітлення адаптується не залежно від присутності кольору чи яскравості в першочерговому `service_data`. Потребує активації `take_over_control`. 🕵️ ",
"transition_until_sleep": "transition_until_sleep: Коли активовано, адаптивне освітлення буде ставитись до налаштування сну як мінімум, переходячи до цих значень після заходу сонця. 🌙"
"adapt_only_on_bare_turn_on": "adapt_only_on_bare_turn_on: На початку вмикання світла. Якщо `true`, освітлення адаптується лише якщо `light.turn_on` викликано без вказання кольору чи яскравості. ❌🌈 Це, наприклад, запобігає адаптації, коли сцена активується. Якщо `false`, освітлення адаптується незалежно від наявності кольору чи яскравості у початковому `service_data`. Потребує ввімкнення `take_over_control`. 🕵️",
"transition_until_sleep": "transition_until_sleep: Коли активовано, адаптивне освітлення буде ставитись до налаштування сну як мінімум, переходячи до цих значень після заходу сонця. 🌙",
"intercept": "intercept: Перехоплювати та адаптувати виклики увімкнення світла (`light.turn_on`), щоб увімкнути миттєву адаптацію кольору та яскравості. 🏎️ Вимкніть для світла, що не підтримує увімкнення світла (`light.turn_on`) з кольором та яскравістю.",
"include_config_in_attributes": "Включити конфігурацію в атрибути (`include_config_in_attributes`): Показувати всі опції як атрибути на перемикачі в Home Assistant, якщо встановлено значення `true`. 📝",
"multi_light_intercept": "multi_light_intercept: Перехоплення та адаптація викликів `light.turn_on`, які спрямовані на кілька світильників. ➗⚠️ Це може призвести до розділення одного виклику `light.turn_on` на кілька викликів, наприклад, коли світильники підключені до різних вимикачів. Потрібно ввімкнути `intercept`.",
"skip_redundant_commands": "skip_redundant_commands: Пропускати надсилання команд адаптації, цільовий стан яких вже дорівнює відомому стану освітлення. Мінімізує мережевий трафік і покращує швидкість реагування адаптації в деяких ситуаціях. 📉Вимкнути, якщо фізичний стан освітлення не синхронізується із записаним станом HA."
},
"data_description": {
"sunrise_offset": "Змінити час сходу сонця на +/- секунд. ⏰",
"sunset_offset": "Змінити час заходу сонця на +/- секунд. ⏰",
"autoreset_control_seconds": "Самочинно скидати ручне керування після кількох секунд. Встановіть 0, щоб вимкнути.",
"initial_transition": "Тривалість першого переходу, коли світло перемикається зі стану вимкнено `off` на увімкнено `on`, у секундах. ⏲️",
"brightness_mode": "Режим яскравості для використання. Можливі значення: default (стандартний) , linear (лінійний) та tanh (гіперболічний тангенс) (використовує значення brightness_mode_time_dark та brightness_mode_time_light).",
"send_split_delay": "Затримка (мс) між `separate_turn_on_commands` (окремі команди увімкнення) для світла, що не підтримує одночасне налаштування яскравості та кольору. ⏲️",
"brightness_mode_time_dark": "(Ігнорується, якщо `brightness_mode='default'`) Тривалість у секундах для збільшення/зменшення яскравості до/після сходу/заходу сонця. 📈📉",
"brightness_mode_time_light": "(Ігнорується, якщо brightness_mode='default') Тривалість у секундах для збільшення/зменшення яскравості після/до сходу/заходу сонця. 📈📉.",
"transition": "Тривалість переходу, коли світло змінюється, у секундах. 🕑",
"interval": "Частота адаптації освітлення, у секундах. 🔄",
"sleep_brightness": "Відсоток яскравості світла в режимі сну. 😴",
"sleep_color_temp": "Колірна температура в режимі сну (використовується, коли `sleep_rgb_or_color_temp` має значення `color_temp`) у Кельвінах. 😴",
"sleep_transition": "Тривалість переходу, коли режим сну \"sleep mode\" увімкнено, у секундах. 😴",
"sleep_rgb_color": "Колір RGB у режимі сну (використовується, коли `sleep_rgb_or_color_temp` має значення \"rgb_color\"). 🌈",
"sunrise_time": "Встановіть фіксований час (ГГ:ХХ:СС) для сходу сонця. 🌅",
"sunset_time": "Встановіть фіксований час (ГГ:ХХ:СС) для заходу сонця. 🌇",
"min_sunrise_time": "Встановіть найраніший час віртуального сходу сонця (ГГ:ХХ:СС), враховуючи пізніші сходи. 🌅",
"min_sunset_time": "Встановіть найраніший час віртуального заходу сонця (ГГ:ХХ:СС), враховуючи пізніші заходи сонця. 🌇",
"max_sunrise_time": "Встановіть найпізніший час віртуального сходу сонця (ГГ:ХХ:СС), враховуючи більш ранні сходи сонця. 🌅",
"max_sunset_time": "Встановіть найновіший час віртуального заходу сонця (ГГ:ХХ:СС), враховуючи більш ранні заходи сонця. 🌇",
"sleep_rgb_or_color_temp": "Використовуйте `\"rgb_color\"` або `\"color_temp\"` у режимі сну. 🌙",
"adapt_delay": "Час очікування (секунди) між увімкненням світла та застосуванням змін системою адаптивного освітлення. Може допомогти уникнути мерехтіння. ⏲️"
}
}
},
@ -48,5 +76,139 @@
"option_error": "Хибна опція",
"entity_missing": "Вибраного світла в домашньому помічнику не знайшли"
}
},
"services": {
"apply": {
"description": "Застосовує поточні налаштування Адаптивного освітлення до світильників.",
"fields": {
"lights": {
"description": "Світильник (або список світильників), до яких буде застосовано налаштування. 💡"
},
"transition": {
"description": "Тривалість переходу, коли світло змінюється, у секундах. 🕑"
},
"entity_id": {
"description": "`entity_id` перемикача з налаштуваннями, які потрібно застосувати. 📝"
},
"adapt_brightness": {
"description": "Чи потрібно адаптувати яскравість світла. 🌞"
},
"adapt_color": {
"description": "Чи адаптувати колір допоміжних ламп. 🌈"
},
"prefer_rgb_color": {
"description": "Чи надавати перевагу налаштуванню кольору RGB над температурою кольору світла, коли це можливо. 🌈"
},
"turn_on_lights": {
"description": "Чи вмикати світло, яке наразі вимкнене. 🔆"
}
}
},
"change_switch_settings": {
"fields": {
"sunrise_offset": {
"description": "Змінити час сходу сонця на +/- секунд. ⏰"
},
"sunset_offset": {
"description": "Змінити час заходу сонця на +/- секунд. ⏰"
},
"autoreset_control_seconds": {
"description": "Самочинно скидати ручне керування після кількох секунд. Встановіть 0, щоб вимкнути."
},
"only_once": {
"description": "Приладжувати освітлення тільки тоді, коли воно ввімкнено (`true`) чи продовжувати завжди (`false`). 🔄"
},
"sleep_brightness": {
"description": "Відсоток яскравості світла в режимі сну. 😴"
},
"take_over_control": {
"description": "Вимкнути Адаптивне освітлення, якщо інше джерело викликає `light.turn_on`, коли світло увімкнене та адаптується. Зауважте, що це викликає `homeassistant.update_entity` щокожного заданого інтервалу `interval`! 🔒"
},
"entity_id": {
"description": "Ідентифікатор (ID) перемикача. 📝"
},
"initial_transition": {
"description": "Тривалість першого переходу, коли світло перемикається зі стану вимкнено `off` на увімкнено `on`, у секундах. ⏲️"
},
"sleep_transition": {
"description": "Тривалість переходу, коли режим сну \"sleep mode\" увімкнено, у секундах. 😴"
},
"max_color_temp": {
"description": "Найхолодніша колірна температура в Кельвінах. ❄️"
},
"max_brightness": {
"description": "Максимальний відсоток яскравості. 💡"
},
"min_brightness": {
"description": "Мінімальний відсоток яскравості. 💡"
},
"send_split_delay": {
"description": "Затримка (мс) між `separate_turn_on_commands` (окремі команди увімкнення) для світла, що не підтримує одночасне налаштування яскравості та кольору. ⏲️"
},
"sleep_color_temp": {
"description": "Колірна температура в режимі сну (використовується, коли `sleep_rgb_or_color_temp` має значення `color_temp`) в Кельвінах. 😴"
},
"detect_non_ha_changes": {
"description": "Виявляє та припиняє адаптації для змін стану, що не є `light.turn_on`. Потребує увімкнення `take_over_control`. 🕵️ Обережно: ⚠️ Деякі лампи можуть хибно вказувати на стан \"увімкнено\", що може призвести до неочікуваного ввімкнення ламп. Вимкніть цю функцію, якщо ви зіткнетеся з такими проблемами."
},
"transition": {
"description": "Тривалість переходу, коли світло змінюється, у секундах. 🕑"
},
"sleep_rgb_color": {
"description": "Колір RGB у режимі сну (використовується, коли `sleep_rgb_or_color_temp` має значення \"rgb_color\"). 🌈"
},
"sunrise_time": {
"description": "Встановіть фіксований час (ГГ:ХХ:СС) для сходу сонця. 🌅"
},
"sunset_time": {
"description": "Встановіть фіксований час (ГГ:ХХ:СС) для заходу сонця. 🌇"
},
"use_defaults": {
"description": "Встановлює значення за замовчуванням, не вказані в цьому виклику служби. Параметри: «current» (за замовчуванням, зберігає поточні значення), «factory» (скидає до задокументованих значень за замовчуванням) або «configuration» (повертає до значень за замовчуванням конфігурації комутатора). ⚙️"
},
"min_sunset_time": {
"description": "Встановіть найраніший час віртуального заходу сонця (ГГ:ХХ:СС), враховуючи пізніші заходи сонця. 🌇"
},
"max_sunrise_time": {
"description": "Встановіть найпізніший час віртуального сходу сонця (ГГ:ХХ:СС), враховуючи більш ранні сходи сонця. 🌅"
},
"include_config_in_attributes": {
"description": "Показувати всі опції як атрибути перемикача в Домашньому помічнику, якщо встановлено значення `true`. 📝"
},
"sleep_rgb_or_color_temp": {
"description": "Використовуйте `\"rgb_color\"` або `\"color_temp\"` у режимі сну. 🌙"
},
"separate_turn_on_commands": {
"description": "Використовуйте окремі виклики `light.turn_on` для кольору та яскравості, що необхідно для деяких типів освітлення. 🔀"
},
"adapt_delay": {
"description": "Час очікування (секунди) між увімкненням світла та застосуванням змін системою адаптивного освітлення. Може допомогти уникнути мерехтіння. ⏲️"
},
"min_color_temp": {
"description": "Найтепліша колірна температура в Кельвінах. 🔥"
},
"prefer_rgb_color": {
"description": "Чи надавати перевагу налаштуванню кольору RGB над температурою кольору світла, коли це можливо. 🌈"
},
"turn_on_lights": {
"description": "Чи вмикати світло, яке наразі вимкнене. 🔆"
}
},
"description": "Змініть будь-які налаштування, які ви бажаєте, у цьому перемикачі. Усі опції тут такі ж, як і в поточному конфігураційному файлі."
},
"set_manual_control": {
"description": "Позначте, чи світло \"керується вручну\".",
"fields": {
"lights": {
"description": "Ідентифікатор(и) світла (entity_id(s) of lights). Якщо не вказано, вибираються всі лампи у перемикачі. 💡"
},
"entity_id": {
"description": "`entity_id` перемикача, в якому потрібно (зняти) позначку світла як `керованого вручну`. 📝"
},
"manual_control": {
"description": "Додавати (\"true\") чи видаляти (\"false\") світло зі списку \"manual_control\". 🔒"
}
}
}
}
}

View file

@ -179,7 +179,7 @@
"include_config_in_attributes": "include_config_in_attributes: 'سچ' پر سیٹ ہونے پر ہوم اسسٹنٹ میں سوئچ پر خصوصیات کے طور پر تمام اختیارات دکھائیں۔ 📝"
},
"title": "مطابقت پذیر روشنی کے اختیارات",
"description": "ایک مطابقت پذیر لائٹنگ جزو تشکیل دیں۔ آپشن کے نام YAML کی ترتیبات کے ساتھ مطابقت رکھتے ہیں۔ اگر آپ نے YAML میں اس اندراج کی وضاحت کی ہے تو ، یہاں کوئی آپشن ظاہر نہیں ہوگا۔ انٹرایکٹو گراف کے لئے جو پیرامیٹر کے اثرات کو ظاہر کرتے ہیں ، ملاحظہ کریں [اس ویب ایپ] (https://basnijholt.github.io/adaptive-lighting)۔ مزید تفصیلات کے لئے ، [سرکاری دستاویزات] (https://github.com/basnijholt/adaptive-lighting#readme) ملاحظہ کریں۔"
"description": "ایک مطابقت پذیر لائٹنگ جزو تشکیل دیں۔ آپشن کے نام YAML کی ترتیبات کے ساتھ مطابقت رکھتے ہیں۔ اگر آپ نے YAML میں اس اندراج کی وضاحت کی ہے تو ، یہاں کوئی آپشن ظاہر نہیں ہوگا۔ انٹرایکٹو گراف کے لئے جو پیرامیٹر کے اثرات کو ظاہر کرتے ہیں ، ملاحظہ کریں [اس ویب ایپ]({webapp_url})۔ مزید تفصیلات کے لئے ، [سرکاری دستاویزات]({docs_url}) ملاحظہ کریں۔"
}
},
"error": {

View file

@ -18,7 +18,7 @@
"step": {
"init": {
"title": "自适应照明选项",
"description": "配置自适应照明组件。选项名称与YAML设置对齐。如果在YAML中定义了此条目,则此处不会显示任何选项。有关演示参数影响的交互式图表,请访问[此Web应用程序](https://basnijholt.github.io/adaptive-lighting)。有关更多详细信息,请参阅[官方文档](https://github.com/basnijholt/adaptive-lighting#readme)。",
"description": "配置自适应照明组件。选项名称与YAML设置对齐。如果在YAML中定义了此条目,则此处不会显示任何选项。有关演示参数影响的交互式图表,请访问[此Web应用程序]({webapp_url})。有关更多详细信息,请参阅[官方文档]({docs_url})。",
"data": {
"lights": "lights:要控制的灯光实体ID列表(可以为空)。🌟",
"interval": "频率(interval)",
@ -50,7 +50,7 @@
"detect_non_ha_changes": "detect_non_ha_changes: 检测非`light.turn_on`的状态更改,并停止自适应照明。需要启用`take_over_control`。🕵️ 注意:⚠️ 一些灯光可能错误地显示为“开启”状态,这可能会导致灯光意外打开。如果遇到此类问题,请禁用此功能。",
"autoreset_control_seconds": "自动重置时间(autoreset_control_seconds)",
"only_once": "only_once:仅在打开时调整灯光(`true`)或始终调整灯光(`false`)。🔄",
"adapt_only_on_bare_turn_on": "adapt_only_on_bare_turn_on:当首次打开灯光时。如果设置为`true`,仅在没有指定颜色或亮度的情况下,AL才进行适应。❌🌈 例如,这可以防止在激活场景时进行适应。如果为`false`,则不考虑初始`service_data`中是否存在颜色或亮度,AL都会适应。需要启用`take_over_control`。🕵️ ",
"adapt_only_on_bare_turn_on": "adapt_only_on_bare_turn_on:当首次打开灯光时。如果设置为`true`,仅在没有指定颜色或亮度的情况下,AL才进行适应。❌🌈 例如,这可以防止在激活场景时进行适应。如果为`false`,则不考虑初始`service_data`中是否存在颜色或亮度,AL都会适应。需要启用`take_over_control`。🕵️",
"separate_turn_on_commands": "separate_turn_on_commands:为某些灯光类型需要使用单独的`light.turn_on`调用来设置颜色和亮度。🔀",
"send_split_delay": "指令发送间隔延迟(send_split_delay)",
"adapt_delay": "自适应照明延迟(adapt_delay)",

1
docs/CNAME Normal file
View file

@ -0,0 +1 @@
adaptive-lighting.nijho.lt

View file

@ -0,0 +1,122 @@
---
icon: lucide/trending-up
---
# Brightness Modes
Enhance your control over brightness transitions during sunrise and sunset with the `brightness_mode` option.
## Available Modes
Adaptive Lighting supports three brightness modes:
| Mode | Description |
|------|-------------|
| `default` | Standard behavior based on sun position |
| `linear` | Linear ramp between min/max brightness |
| `tanh` | Smooth S-curve using hyperbolic tangent |
## Detailed Explanation
<!-- CODE:START -->
<!-- print(include_section("../../README.md", "brightness-modes", strip_heading=True)) -->
<!-- CODE:END -->
<!-- OUTPUT:START -->
<!-- ⚠️ This content is auto-generated by `markdown-code-runner`. -->
<details markdown="1">
<summary>Enhance your control over brightness transitions during sunrise and sunset with <code>brightness_mode</code> (click here to learn more 🧠).</summary>
With Adaptive Lighting, you can set a `brightness_mode` to specify how the brightness changes during sunrise and sunset. The `brightness_mode` can be set to `"default"` ([as illustrated in other graphs above](#high_brightness-brightness)), `"linear"`, or `"tanh"`. If you choose to deviate from the `"default"` mode, you can adjust `brightness_mode_time_dark` and `brightness_mode_time_light` to further customize the lighting transitions.
When `brightness_mode` is set to `"linear"`:
- During **_sunset_**, the brightness begins to gradually decrease from `max_brightness` starting at `time=sunset_time - brightness_mode_time_light`, until it reaches `min_brightness` at `time=sunset_time + brightness_mode_time_dark`.
- During **_sunrise_**, the brightness begins to gradually increase from `min_brightness` starting at `time=sunrise_time - brightness_mode_time_dark`, until it reaches `max_brightness` at `time=sunrise_time + brightness_mode_time_light`.
When `brightness_mode` is set to `"tanh"`, it uses the smooth transition of a [hyperbolic tangent function](https://mathworld.wolfram.com/HyperbolicTangent.html):
- During **_sunset_**, the brightness starts to decrease from 95% of `max_brightness` starting at `time=sunset_time - brightness_mode_time_light`, until it reaches 5% of `min_brightness` at `time=sunset_time + brightness_mode_time_dark`.
- During **_sunrise_**, the brightness starts to increase from 5% of `min_brightness` starting at `time=sunrise_time - brightness_mode_time_dark`, until it reaches 95% of `max_brightness` at `time=sunrise_time + brightness_mode_time_light`.
</details>
Notice the values of `brightness_mode_time_light` and `brightness_mode_time_dark` in the text box.
![image](https://github.com/basnijholt/adaptive-lighting/assets/6897215/15143580-13cd-4ab2-a603-89f2b7830afd)
![image](https://github.com/basnijholt/adaptive-lighting/assets/6897215/f61fdac9-6d47-48c9-84ed-cbb451d5de5d)
![image](https://github.com/basnijholt/adaptive-lighting/assets/6897215/e5fc5d27-3c37-4e3d-93d1-6e7cf4b48e7c)
![image](https://github.com/basnijholt/adaptive-lighting/assets/6897215/3dcbdc42-63c4-49df-8651-d2fae53dd08d)
> Check out the interactive webapp on https://basnijholt.github.io/adaptive-lighting/ to play with the parameters and see how the brightness changes!
<!-- OUTPUT:END -->
## Configuration Parameters
When using `linear` or `tanh` modes, you can fine-tune the transition with these parameters:
| Parameter | Default | Description |
|-----------|---------|-------------|
| `brightness_mode_time_dark` | 900 (15 min) | Duration to ramp brightness before/after sunrise/sunset |
| `brightness_mode_time_light` | 3600 (1 hour) | Duration to ramp brightness after/before sunrise/sunset |
## Example Configurations
### Quick Transition (Linear)
```yaml
adaptive_lighting:
- name: "Quick transitions"
lights:
- light.living_room
brightness_mode: linear
brightness_mode_time_dark: 600 # 10 minutes
brightness_mode_time_light: 1800 # 30 minutes
```
### Smooth Transition (Tanh)
```yaml
adaptive_lighting:
- name: "Smooth transitions"
lights:
- light.bedroom
brightness_mode: tanh
brightness_mode_time_dark: 1200 # 20 minutes
brightness_mode_time_light: 3600 # 1 hour
```
## Graphs
These graphs show how brightness changes throughout the day based on calculated values:
<!-- CODE:START -->
<!-- print(include_section("../../README.md", "graphs", strip_heading=True)) -->
<!-- CODE:END -->
<!-- OUTPUT:START -->
<!-- ⚠️ This content is auto-generated by `markdown-code-runner`. -->
These graphs were generated using the values calculated by the Adaptive Lighting sensor/switch(es).
### :sunny: Sun Position
![cl_percent|690x131](https://community-home-assistant-assets.s3.dualstack.us-west-2.amazonaws.com/original/3X/6/5/657ff98beb65a94598edeb4bdfd939095db1a22c.PNG)
### :thermometer: Color Temperature
![cl_color_temp|690x129](https://community-home-assistant-assets.s3.dualstack.us-west-2.amazonaws.com/original/3X/5/9/59e84263cbecd8e428cb08777a0413672c48dfcd.PNG)
### :high_brightness: Brightness
![cl_brightness|690x130](https://community-home-assistant-assets.s3.dualstack.us-west-2.amazonaws.com/original/3X/5/8/58ebd994b62a8b1abfb3497a5288d923ff4e2330.PNG)
### While using `transition_until_sleep: true`
![image](https://user-images.githubusercontent.com/2219836/228949675-f9699624-8abc-466c-bb04-250ce0f495b8.png)
<!-- OUTPUT:END -->
## Interactive Simulator
The best way to understand brightness modes is to experiment with the interactive simulator:
<div style="text-align: center; margin: 2rem 0;">
<a href="../simulator/" class="simulator-link">
Try the Simulator
</a>
</div>
Adjust the `brightness_mode`, `brightness_mode_time_dark`, and `brightness_mode_time_light` parameters to see how they affect the brightness curve in real-time.

View file

@ -0,0 +1,161 @@
---
icon: lucide/hand
---
# Manual Control
Adaptive Lighting is designed to work seamlessly with manual adjustments, detecting when you or another source changes light settings and pausing adaptation accordingly.
## How It Works
<!-- CODE:START -->
<!-- print(include_section("../../README.md", "manual-control", strip_heading=True)) -->
<!-- CODE:END -->
<!-- OUTPUT:START -->
<!-- ⚠️ This content is auto-generated by `markdown-code-runner`. -->
Adaptive Lighting is designed to automatically detect when you or another source (e.g., automation) manually changes light settings 🕹️.
When this occurs, the affected light is marked as "manually controlled," and Adaptive Lighting will not make further adjustments until the light is turned off and back on or reset using the `adaptive_lighting.set_manual_control` service call.
This feature is available when `take_over_control` is enabled.
Additionally, enabling `detect_non_ha_changes` allows Adaptive Lighting to detect all state changes, including those made outside of Home Assistant, by comparing the light's state to its previously used settings.
The `adaptive_lighting.manual_control` event is fired when a light is marked as "manually controlled," allowing for integration with automations 🤖.
> ⚠️ **_Caution: Some lights might falsely indicate an 'on' state, which could result in lights turning on unexpectedly. Disable `detect_non_ha_changes` if you encounter such issues._**
<!-- OUTPUT:END -->
## Configuration Options
### take_over_control
When enabled (default: `true`), Adaptive Lighting detects `light.turn_on` service calls that specify brightness or color values. If such a call is detected for a light that's already on, that light is marked as "manually controlled".
```yaml
adaptive_lighting:
- name: "With manual control detection"
lights:
- light.living_room
take_over_control: true # default
```
### take_over_control_mode
Controls how adaptation pauses when manual changes are detected:
| Mode | Behavior |
|------|----------|
| `pause_all` | Pause both brightness and color adaptation (default) |
| `pause_changed` | Only pause adaptation of the changed attribute |
```yaml
adaptive_lighting:
- name: "Selective pause"
lights:
- light.living_room
take_over_control: true
take_over_control_mode: pause_changed # Only pause changed attributes
```
### detect_non_ha_changes
When enabled, Adaptive Lighting detects state changes made outside of Home Assistant by comparing the light's current state to its previously applied settings.
> [!WARNING]
> **Use with caution.** Some lights may falsely report an "on" state, which could result in lights turning on unexpectedly. Disable this option if you encounter such issues.
```yaml
adaptive_lighting:
- name: "Detect external changes"
lights:
- light.living_room
take_over_control: true
detect_non_ha_changes: true
```
### autoreset_control_seconds
Automatically resets the manual control flag after a specified number of seconds. Set to `0` to disable (default).
```yaml
adaptive_lighting:
- name: "Auto-reset after 2 hours"
lights:
- light.living_room
take_over_control: true
autoreset_control_seconds: 7200 # 2 hours
```
### adapt_only_on_bare_turn_on
When enabled, Adaptive Lighting only adapts lights when `light.turn_on` is called without specifying brightness or color. This is useful when you want scenes to work without interference.
```yaml
adaptive_lighting:
- name: "Respect scenes"
lights:
- light.living_room
take_over_control: true
adapt_only_on_bare_turn_on: true
```
## Checking Manual Control Status
You can see which lights are marked as manually controlled by checking the switch attributes:
1. Go to **Developer Tools** → **States**
2. Find your Adaptive Lighting switch (e.g., `switch.adaptive_lighting_living_room`)
3. Look at the `manual_control` attribute - it lists all manually controlled lights
## Resetting Manual Control
### Via Service Call
```yaml
service: adaptive_lighting.set_manual_control
data:
entity_id: switch.adaptive_lighting_living_room
lights:
- light.floor_lamp
manual_control: false # Resume adaptation
```
### By Turning Light Off and On
Simply turning a light off and then back on will reset its manual control status.
### Via Automation
See [Automation Examples](../automation-examples.md) for automation recipes that automatically reset manual control.
## Events
When a light is marked as manually controlled, Adaptive Lighting fires an event:
**Event type:** `adaptive_lighting.manual_control`
**Event data:**
```yaml
entity_id: light.living_room
switch: switch.adaptive_lighting_living_room
```
You can use this event to trigger automations:
```yaml
automation:
- alias: "Notify on manual control"
trigger:
platform: event
event_type: adaptive_lighting.manual_control
action:
- service: notify.mobile_app
data:
message: "{{ trigger.event.data.entity_id }} was manually adjusted"
```
## Best Practices
1. **Use Zigbee groups** when controlling multiple bulbs together - this ensures consistent manual control detection
2. **Set reasonable autoreset times** if you want lights to eventually resume adaptation
3. **Use `pause_changed` mode** if you only adjust brightness or color individually
4. **Disable `detect_non_ha_changes`** if you experience unexpected light turn-ons

View file

@ -0,0 +1,43 @@
---
icon: lucide/moon
---
# Sleep Mode
Sleep mode is a special operating mode that sets your lights to minimal brightness and very warm color, perfect for winding down at night without disrupting your circadian rhythm.
## Activating Sleep Mode
Each Adaptive Lighting configuration creates a sleep mode switch:
```
switch.adaptive_lighting_sleep_mode_<name>
```
Turn it on to activate sleep mode:
```yaml
service: switch.turn_on
target:
entity_id: switch.adaptive_lighting_sleep_mode_living_room
```
## Configuration Options
Sleep mode is configured through the main Adaptive Lighting configuration. See the [Configuration](../configuration.md) page for the full options table. The sleep-related options are:
| Option | Default | Description |
|--------|---------|-------------|
| `sleep_brightness` | 1 | Brightness percentage in sleep mode |
| `sleep_rgb_or_color_temp` | `color_temp` | Use `rgb_color` or `color_temp` in sleep mode |
| `sleep_color_temp` | 1000 | Color temperature in Kelvin for sleep mode |
| `sleep_rgb_color` | `[255, 56, 0]` | RGB color for sleep mode |
| `sleep_transition` | 1 | Transition duration in seconds |
| `transition_until_sleep` | false | Gradually transition to sleep settings after sunset |
## Automation Examples
See [Automation Examples](../automation-examples.md) for sleep mode automation recipes, including:
- Toggle sleep mode using an `input_boolean`
- Set sunrise/sunset based on alarm time

BIN
docs/assets/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View file

@ -0,0 +1,46 @@
/* Adaptive Lighting Documentation Custom Styles */
/* Hero section on index page */
.md-content__inner > h1:first-child {
font-size: 2.5rem;
margin-bottom: 0.5rem;
}
/* Logo in header - make it slightly larger */
.md-header__button.md-logo img {
height: 1.8rem;
}
/* Simulator link button styling */
.simulator-link {
display: inline-block;
padding: 0.75rem 1.5rem;
background: linear-gradient(135deg, var(--md-primary-fg-color), var(--md-accent-fg-color));
color: white !important;
text-decoration: none;
border-radius: 2rem;
font-weight: 600;
font-size: 1.1rem;
transition: transform 0.2s ease, box-shadow 0.2s ease;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
.simulator-link:hover {
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
text-decoration: none;
}
/* Code block improvements */
.highlight code {
font-size: 0.85rem;
}
/* Table improvements */
.md-typeset table:not([class]) {
font-size: 0.8rem;
}
.md-typeset table:not([class]) th {
font-weight: 700;
}

115
docs/automation-examples.md Normal file
View file

@ -0,0 +1,115 @@
---
icon: lucide/bot
---
# Automation Examples
Real-world automation examples showing how to integrate Adaptive Lighting with your Home Assistant setup.
<!-- CODE:START -->
<!-- from adaptive_lighting.docs_gen import _transform_readme_links -->
<!-- print(_transform_readme_links(include_section("../README.md", "automation-examples", strip_heading=True))) -->
<!-- CODE:END -->
<!-- OUTPUT:START -->
<!-- ⚠️ This content is auto-generated by `markdown-code-runner`. -->
<details markdown="1">
<summary>Reset the <code>manual_control</code> status of a light after an hour.</summary>
```yaml
- alias: "Adaptive lighting: reset manual_control after 1 hour"
mode: parallel
trigger:
platform: event
event_type: adaptive_lighting.manual_control
variables:
light: "{{ trigger.event.data.entity_id }}"
switch: "{{ trigger.event.data.switch }}"
action:
- delay: "01:00:00"
- condition: template
value_template: "{{ light in state_attr(switch, 'manual_control') }}"
- service: adaptive_lighting.set_manual_control
data:
entity_id: "{{ switch }}"
lights: "{{ light }}"
manual_control: false
```
</details>
<details markdown="1">
<summary>Toggle multiple Adaptive Lighting switches to "sleep mode" using an <code>input_boolean.sleep_mode</code>.</summary>
```yaml
- alias: "Adaptive lighting: toggle 'sleep mode'"
trigger:
- platform: state
entity_id: input_boolean.sleep_mode
- platform: homeassistant
event: start # in case the states aren't properly restored
variables:
sleep_mode: "{{ states('input_boolean.sleep_mode') }}"
action:
service: "switch.turn_{{ sleep_mode }}"
entity_id:
- switch.adaptive_lighting_sleep_mode_living_room
- switch.adaptive_lighting_sleep_mode_bedroom
```
Set your sunrise and sunset time based on your alarm. The below script sets sunset_time exactly 12 hours after the custom sunrise time.
```yaml
iphone_carly_wakeup:
alias: iPhone Carly Wakeup
sequence:
- condition: state
entity_id: input_boolean.carly_iphone_wakeup
state: "off"
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.carly_iphone_wakeup
data:
time: '{{ now().strftime("%H:%M:%S") }}'
- service: input_boolean.turn_on
target:
entity_id: input_boolean.carly_iphone_wakeup
- repeat:
count: >
{{ (states.switch
| map(attribute="entity_id")
| select(">","switch.adaptive_lighting_al_")
| select("<", "switch.adaptive_lighting_al_z")
| join(",")
).split(",") | length }}
sequence:
- service: adaptive_lighting.change_switch_settings
data:
entity_id: switch.adaptive_lighting_al_den_ceilingfan_lights
sunrise_time: '{{ now().strftime("%H:%M:%S") }}'
sunset_time: >
{{ (as_timestamp(now()) + 12*60*60) | timestamp_custom("%H:%M:%S") }}
- service: script.turn_on
target:
entity_id: script.run_wakeup_routine
- service: input_boolean.turn_off
target:
entity_id:
- input_boolean.carly_iphone_winddown
- input_boolean.carly_iphone_bedtime
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.wakeup_time
data:
time: '{{ now().strftime("%H:%M:%S") }}'
- service: script.adaptive_lighting_disable_sleep_mode
mode: queued
icon: mdi:weather-sunset
max: 10
```
</details>
<!-- OUTPUT:END -->
> [!TIP]
> **Have a useful automation?** Share your automation examples by [opening an issue](https://github.com/basnijholt/adaptive-lighting/issues) or submitting a pull request to the README.

150
docs/configuration.md Normal file
View file

@ -0,0 +1,150 @@
---
icon: lucide/settings
---
# Configuration
Adaptive Lighting supports configuration through both YAML and the Home Assistant UI, with identical option names in both methods.
## Basic Configuration
The minimal configuration requires only adding the integration to your `configuration.yaml`:
```yaml
adaptive_lighting:
```
You can then configure everything through the UI at **Settings** → **Devices & Services** → **Adaptive Lighting** → **Configure**.
## YAML Configuration
For YAML configuration, you can specify lights and options directly:
```yaml
adaptive_lighting:
- name: "Living Room"
lights:
- light.living_room_ceiling
- light.living_room_lamp
```
## All Options
All configuration options are listed below with their default values. These options work identically in both YAML and the UI.
<!-- CODE:START -->
<!-- from adaptive_lighting._docs_helpers import generate_config_markdown_table -->
<!-- print(generate_config_markdown_table()) -->
<!-- CODE:END -->
<!-- OUTPUT:START -->
<!-- ⚠️ This content is auto-generated by `markdown-code-runner`. -->
| Variable name | Description | Default | Type |
|:-------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------|:----------------------------------------|
| `lights` | List of light entity_ids to be controlled (may be empty). 🌟 | `[]` | list of `entity_id`s |
| `interval` | Frequency to adapt the lights, in seconds. 🔄 | `90` | `int > 0` |
| `transition` | Duration of transition when lights change, in seconds. 🕑 | `45` | `float` 0-6553 |
| `initial_transition` | Duration of the first transition when lights turn from `off` to `on` in seconds. ⏲️ | `1` | `float` 0-6553 |
| `min_brightness` | Minimum brightness percentage. 💡 | `1` | `int` 1-100 |
| `max_brightness` | Maximum brightness percentage. 💡 | `100` | `int` 1-100 |
| `min_color_temp` | Warmest color temperature in Kelvin. 🔥 | `2000` | `int` 1000-10000 |
| `max_color_temp` | Coldest color temperature in Kelvin. ❄️ | `5500` | `int` 1000-10000 |
| `prefer_rgb_color` | Whether to prefer RGB color adjustment over light color temperature when possible. 🌈 | `False` | `bool` |
| `sleep_brightness` | Brightness percentage of lights in sleep mode. 😴 | `1` | `int` 1-100 |
| `sleep_rgb_or_color_temp` | Use either `"rgb_color"` or `"color_temp"` in sleep mode. 🌙 | `color_temp` | one of `['color_temp', 'rgb_color']` |
| `sleep_color_temp` | Color temperature in sleep mode (used when `sleep_rgb_or_color_temp` is `color_temp`) in Kelvin. 😴 | `1000` | `int` 1000-10000 |
| `sleep_rgb_color` | RGB color in sleep mode (used when `sleep_rgb_or_color_temp` is "rgb_color"). 🌈 | `[255, 56, 0]` | RGB color |
| `sleep_transition` | Duration of transition when "sleep mode" is toggled in seconds. 😴 | `1` | `float` 0-6553 |
| `transition_until_sleep` | When enabled, Adaptive Lighting will treat sleep settings as the minimum, transitioning to these values after sunset. 🌙 | `False` | `bool` |
| `sunrise_time` | Set a fixed time (HH:MM:SS) for sunrise. 🌅 | `None` | `str` |
| `min_sunrise_time` | Set the earliest virtual sunrise time (HH:MM:SS), allowing for later sunrises. 🌅 | `None` | `str` |
| `max_sunrise_time` | Set the latest virtual sunrise time (HH:MM:SS), allowing for earlier sunrises. 🌅 | `None` | `str` |
| `sunrise_offset` | Adjust sunrise time with a positive or negative offset in seconds. ⏰ | `0` | `int` |
| `sunset_time` | Set a fixed time (HH:MM:SS) for sunset. 🌇 | `None` | `str` |
| `min_sunset_time` | Set the earliest virtual sunset time (HH:MM:SS), allowing for later sunsets. 🌇 | `None` | `str` |
| `max_sunset_time` | Set the latest virtual sunset time (HH:MM:SS), allowing for earlier sunsets. 🌇 | `None` | `str` |
| `sunset_offset` | Adjust sunset time with a positive or negative offset in seconds. ⏰ | `0` | `int` |
| `brightness_mode` | Brightness mode to use. Possible values are `default`, `linear`, and `tanh` (uses `brightness_mode_time_dark` and `brightness_mode_time_light`). 📈 | `default` | one of `['default', 'linear', 'tanh']` |
| `brightness_mode_time_dark` | (Ignored if `brightness_mode='default'`) The duration in seconds to ramp up/down the brightness before/after sunrise/sunset. 📈📉 | `900` | `int` |
| `brightness_mode_time_light` | (Ignored if `brightness_mode='default'`) The duration in seconds to ramp up/down the brightness after/before sunrise/sunset. 📈📉. | `3600` | `int` |
| `take_over_control` | Pause adaptation of individual lights and hand over (manual) control to other sources that issue `light.turn_on` calls for lights that are on. 🔒 | `True` | `bool` |
| `take_over_control_mode` | The adaptation pausing mode when other sources change brightness and/or color of lights. `pause_all` always pauses both brightness and color adaptation. `pause_changed` pauses the adaptation of only the changed attributes and continues adapting unchanged attributes, e.g., continues color adaptation when only brightness was changed. | `pause_all` | one of `['pause_all', 'pause_changed']` |
| `detect_non_ha_changes` | Detects and halts adaptations for non-`light.turn_on` state changes. Needs `take_over_control` enabled. 🕵️ Caution: ⚠️ Some lights might falsely indicate an 'on' state, which could result in lights turning on unexpectedly. Note that this calls `homeassistant.update_entity` every `interval`! Disable this feature if you encounter such issues. | `False` | `bool` |
| `autoreset_control_seconds` | Automatically reset the manual control after a number of seconds. Set to 0 to disable. ⏲️ | `0` | `int` 0-31536000 |
| `only_once` | Adapt lights only when they are turned on (`true`) or keep adapting them (`false`). 🔄 | `False` | `bool` |
| `adapt_only_on_bare_turn_on` | When turning lights on initially. If set to `true`, AL adapts only if `light.turn_on` is invoked without specifying color or brightness. ❌🌈 This e.g., prevents adaptation when activating a scene and marks the light as manually controlled. If `false`, AL adapts regardless of the presence of color or brightness in the initial `service_data`. Needs `take_over_control` enabled. 🕵️ | `False` | `bool` |
| `separate_turn_on_commands` | Use separate `light.turn_on` calls for color and brightness, needed for some light types. 🔀 | `False` | `bool` |
| `send_split_delay` | Delay (ms) between `separate_turn_on_commands` for lights that don't support simultaneous brightness and color setting. ⏲️ | `0` | `int` 0-10000 |
| `adapt_delay` | Wait time (seconds) between light turn on and Adaptive Lighting applying changes. Might help to avoid flickering. ⏲️ | `0` | `float > 0` |
| `skip_redundant_commands` | Skip sending adaptation commands whose target state already equals the light's known state. Minimizes network traffic and improves the adaptation responsivity in some situations. 📉Disable if physical light states get out of sync with HA's recorded state. | `False` | `bool` |
| `intercept` | Intercept and adapt `light.turn_on` calls to enabling instantaneous color and brightness adaptation. 🏎️ Disable for lights that do not support `light.turn_on` with color and brightness. | `True` | `bool` |
| `multi_light_intercept` | Intercept and adapt `light.turn_on` calls that target multiple lights. ➗⚠️ This might result in splitting up a single `light.turn_on` call into multiple calls, e.g., when lights are in different switches. Requires `intercept` to be enabled. | `True` | `bool` |
| `include_config_in_attributes` | Show all options as attributes on the switch in Home Assistant when set to `true`. 📝 | `False` | `bool` |
<!-- OUTPUT:END -->
## Full Configuration Example
<!-- CODE:START -->
<!-- from adaptive_lighting.docs_gen import _transform_readme_links -->
<!-- print(_transform_readme_links(include_section("../README.md", "config-example-full"))) -->
<!-- CODE:END -->
<!-- OUTPUT:START -->
<!-- ⚠️ This content is auto-generated by `markdown-code-runner`. -->
Full example:
```yaml
# Example configuration.yaml entry
adaptive_lighting:
- name: "default"
lights: []
prefer_rgb_color: false
transition: 45
initial_transition: 1
interval: 90
min_brightness: 1
max_brightness: 100
min_color_temp: 2000
max_color_temp: 5500
sleep_brightness: 1
sleep_color_temp: 1000
sunrise_time: "08:00:00" # override the sunrise time
sunrise_offset:
sunset_time:
sunset_offset: 1800 # in seconds or '00:30:00'
take_over_control: true
detect_non_ha_changes: false
only_once: false
```
<!-- OUTPUT:END -->
## Multiple Configurations
You can create multiple Adaptive Lighting configurations for different areas or use cases:
```yaml
adaptive_lighting:
- name: "Daytime Spaces"
lights:
- light.living_room
- light.kitchen
- light.office
min_brightness: 30
max_brightness: 100
- name: "Bedroom"
lights:
- light.bedroom_ceiling
- light.bedroom_lamp
min_brightness: 5
max_brightness: 80
sleep_brightness: 1
sleep_color_temp: 1000
```
## Related Topics
- [Brightness Modes](advanced/brightness-modes.md) - Detailed explanation of brightness calculation modes
- [Sleep Mode](advanced/sleep-mode.md) - Sleep mode configuration
- [Manual Control](advanced/manual-control.md) - How manual control detection works

117
docs/getting-started.md Normal file
View file

@ -0,0 +1,117 @@
---
icon: lucide/rocket
---
# Getting Started
This guide will help you install and configure Adaptive Lighting for the first time.
## Prerequisites
- [Home Assistant](https://www.home-assistant.io/) 2024.12.0 or newer
- [HACS](https://hacs.xyz/) (Home Assistant Community Store) installed
## Installation
### Via HACS (Recommended)
1. Open HACS in your Home Assistant instance
2. Click on **Integrations**
3. Click the **+ Explore & Download Repositories** button
4. Search for "Adaptive Lighting"
5. Click **Download**
6. Restart Home Assistant
Or use this button to open HACS directly:
[![Open your Home Assistant instance and open the Adaptive Lighting integration inside the Home Assistant Community Store.](https://my.home-assistant.io/badges/hacs_repository.svg)](https://my.home-assistant.io/redirect/hacs_repository/?owner=basnijholt&repository=adaptive-lighting&category=integration)
### Manual Installation
1. Download the latest release from [GitHub](https://github.com/basnijholt/adaptive-lighting/releases)
2. Extract the `adaptive_lighting` folder to your `config/custom_components/` directory
3. Restart Home Assistant
## Configuration
### Step 1: Add to configuration.yaml
Add the following to your `configuration.yaml`:
```yaml
adaptive_lighting:
```
> [!NOTE]
> This entry is required even if you plan to configure everything through the UI.
### Step 2: Restart Home Assistant
Restart Home Assistant for the changes to take effect.
### Step 3: Add the Integration
1. Go to **Settings** → **Devices & Services**
2. Click **+ Add Integration**
3. Search for "Adaptive Lighting"
4. Follow the setup wizard to select your lights
### Step 4: Configure Your Lights
You can configure Adaptive Lighting in two ways:
=== "Via UI"
1. Go to **Settings** → **Devices & Services**
2. Find Adaptive Lighting and click **Configure**
3. Adjust settings as needed
=== "Via YAML"
```yaml
adaptive_lighting:
- name: "Living Room"
lights:
- light.living_room_ceiling
- light.living_room_lamp
min_brightness: 20
max_brightness: 100
min_color_temp: 2200
max_color_temp: 5500
```
## Basic Configuration Example
Here's a simple configuration to get you started:
```yaml
adaptive_lighting:
- name: "Main Lights"
lights:
- light.living_room
- light.bedroom
- light.kitchen
transition: 30
min_brightness: 10
max_brightness: 100
min_color_temp: 2000
max_color_temp: 5500
```
## Verifying Installation
After configuration, you should see new switches in Home Assistant:
- `switch.adaptive_lighting_main_lights`
- `switch.adaptive_lighting_sleep_mode_main_lights`
- `switch.adaptive_lighting_adapt_brightness_main_lights`
- `switch.adaptive_lighting_adapt_color_main_lights`
Turn on `switch.adaptive_lighting_main_lights` to start adapting your lights!
## Next Steps
- [Configuration Reference](configuration.md) - Explore all available options
- [Services](services.md) - Learn about service calls for automations
- [Automation Examples](automation-examples.md) - See real-world automation recipes
- [Troubleshooting](troubleshooting.md) - Common issues and solutions

85
docs/index.md Normal file
View file

@ -0,0 +1,85 @@
---
icon: lucide/sun
---
# Adaptive Lighting
**Enhance Your Home's Atmosphere with Smart, Sun-Synchronized Lighting**
<div style="text-align: center; margin: 2rem 0;">
<img src="assets/logo.png" alt="Adaptive Lighting Logo" width="200" />
</div>
[Adaptive Lighting](https://github.com/basnijholt/adaptive-lighting) is a custom component for [Home Assistant](https://www.home-assistant.io/) that intelligently adjusts the brightness and color of your lights based on the sun's position, while still allowing for manual control.
<div style="text-align: center; margin: 2rem 0;">
<a href="https://my.home-assistant.io/redirect/hacs_repository/?owner=basnijholt&repository=adaptive-lighting&category=integration" class="md-button md-button--primary">
Install via HACS
</a>
<a href="simulator/" class="md-button">
Try the Simulator
</a>
</div>
By automatically adapting the settings of your lights throughout the day, Adaptive Lighting helps maintain your natural circadian rhythm, which can lead to improved sleep, mood, and overall well-being. Experience cooler color temperatures at noon, gradually transitioning to warmer colors at sunset and sunrise.
## Features
<!-- CODE:START -->
<!-- from adaptive_lighting.docs_gen import _transform_readme_links -->
<!-- print(_transform_readme_links(include_section("../README.md", "features", strip_heading=True))) -->
<!-- CODE:END -->
<!-- OUTPUT:START -->
<!-- ⚠️ This content is auto-generated by `markdown-code-runner`. -->
When initially turning on a light that is controlled by Adaptive Lighting, the `light.turn_on` service call is intercepted, and the light's brightness and color are automatically adjusted based on the sun's position.
After that, the light's brightness and color are automatically adjusted at a regular interval.
Adaptive Lighting provides four switches (using "living_room" as an example component name):
- `switch.adaptive_lighting_living_room`: Turn Adaptive Lighting on or off and view current light settings through its attributes.
- `switch.adaptive_lighting_sleep_mode_living_room`: Activate "sleep mode" 😴 and set custom sleep_brightness and sleep_color_temp.
- `switch.adaptive_lighting_adapt_brightness_living_room`: Enable or disable brightness adaptation 🔆 for supported lights.
- `switch.adaptive_lighting_adapt_color_living_room`: Enable or disable color adaptation 🌈 for supported lights.
<!-- OUTPUT:END -->
## Quick Start
1. **Install via HACS**: Search for "Adaptive Lighting" in the [Home Assistant Community Store](https://hacs.xyz/)
2. **Add to configuration**: Add `adaptive_lighting:` to your `configuration.yaml`
3. **Configure**: Go to **Settings** → **Devices & Services** → **Add Integration** → **Adaptive Lighting**
4. **Select your lights**: Choose which lights to control and enjoy automatic adaptation!
```yaml
# Minimal configuration.yaml entry
adaptive_lighting:
lights:
- light.living_room
```
> [!TIP]
> **Using the UI exclusively?** Even if you plan to configure everything through the UI, the `adaptive_lighting:` entry must still be present in your `configuration.yaml`.
[Get Started →](getting-started.md){ .md-button .md-button--primary }
[View All Options →](configuration.md){ .md-button }
## How It Works
Adaptive Lighting provides four switches for each configuration (using "living_room" as an example):
| Switch | Purpose |
|--------|---------|
| `switch.adaptive_lighting_living_room` | Main on/off control |
| `switch.adaptive_lighting_sleep_mode_living_room` | Activate sleep mode |
| `switch.adaptive_lighting_adapt_brightness_living_room` | Enable/disable brightness adaptation |
| `switch.adaptive_lighting_adapt_color_living_room` | Enable/disable color adaptation |
## Interactive Simulator
Visualize how Adaptive Lighting will work with your settings using the interactive simulator:
<div style="text-align: center; margin: 2rem 0;">
<a href="simulator/" class="simulator-link">
Try the Interactive Simulator
</a>
</div>

View file

@ -0,0 +1,6 @@
<!-- Privacy-friendly analytics by Plausible -->
<script async src="https://plausible.nijho.lt/js/pa-yNpTS2silFzWxGYjHM_Bk.js"></script>
<script>
window.plausible=window.plausible||function(){(plausible.q=plausible.q||[]).push(arguments)},plausible.init=plausible.init||function(i){plausible.o=i||{}};
plausible.init()
</script>

View file

@ -0,0 +1,71 @@
#!/usr/bin/env python3
# ruff: noqa: T201, S603, S607
"""Update all markdown files that use markdown-code-runner for auto-generation.
Run from repo root: uv run python docs/run_markdown_code_runner.py
"""
from __future__ import annotations
import subprocess
import sys
from pathlib import Path
def find_markdown_files_with_code_blocks(docs_dir: Path) -> list[Path]:
"""Find all markdown files containing markdown-code-runner markers."""
files_with_code = []
for md_file in docs_dir.rglob("*.md"):
content = md_file.read_text()
if "<!-- CODE:START -->" in content:
files_with_code.append(md_file)
return sorted(files_with_code)
def run_markdown_code_runner(files: list[Path], repo_root: Path) -> bool:
"""Run markdown-code-runner on all files. Returns True if all succeeded."""
if not files:
print("No files with CODE:START markers found.")
return True
print(f"Found {len(files)} file(s) with auto-generated content:")
for f in files:
print(f" - {f.relative_to(repo_root)}")
print()
all_success = True
for file in files:
rel_path = file.relative_to(repo_root)
print(f"Updating {rel_path}...", end=" ", flush=True)
result = subprocess.run(
["markdown-code-runner", str(file)],
check=False,
capture_output=True,
text=True,
)
if result.returncode == 0:
print("✓")
else:
print("✗")
print(f" Error: {result.stderr}")
all_success = False
return all_success
def main() -> int:
"""Main entry point."""
repo_root = Path(__file__).parent.parent
# Process docs/ files and README.md
files = find_markdown_files_with_code_blocks(repo_root / "docs")
readme = repo_root / "README.md"
if readme.exists() and "<!-- CODE:START -->" in readme.read_text():
files.append(readme)
success = run_markdown_code_runner(files, repo_root)
return 0 if success else 1
if __name__ == "__main__":
sys.exit(main())

73
docs/see-also.md Normal file
View file

@ -0,0 +1,73 @@
---
icon: lucide/external-link
---
# See Also
Resources, tutorials, and related projects for Adaptive Lighting.
## Tutorials & Articles
<!-- CODE:START -->
<!-- from adaptive_lighting.docs_gen import _transform_readme_links -->
<!-- print(_transform_readme_links(include_section("../README.md", "see-also", strip_heading=True))) -->
<!-- CODE:END -->
<!-- OUTPUT:START -->
<!-- ⚠️ This content is auto-generated by `markdown-code-runner`. -->
- [*Sleep better with Adaptive Lighting in Home Assistant*](https://wartner.io/sleep-better-with-adaptive-lightning-in-home-assistant/) by Florian Wartner on 2023-02-23 (blog post 📜)
- [*Automatic smart light brightness and color based on the sun*](https://www.youtube.com/watch?v=Rg3zI1Oyk3c) by Home Automation Guy on 2022-08-31 (YouTube video 📺)
- [*Adaptive Lighting Blew My Mind in Home Assistant - How to set it up*](https://www.youtube.com/watch?v=c1cnccmgl3k) by Smart Home Junkie on 2022-06-26 (YouTube video 📺)
<!-- OUTPUT:END -->
## Interactive Tools
### Adaptive Lighting Simulator
Visualize how different settings affect your lighting throughout the day:
<div style="text-align: center; margin: 2rem 0;">
<a href="../simulator/" class="simulator-link">
Open the Simulator
</a>
</div>
The simulator lets you:
- Adjust all configuration parameters in real-time
- See how brightness and color temperature change throughout the day
- Visualize the effects of different `brightness_mode` settings
- Test sleep mode transitions
## Related Projects
### Circadian Lighting
Adaptive Lighting was initially inspired by [hass-circadian_lighting](https://github.com/claytonjn/hass-circadian_lighting) by @claytonjn, but has since been entirely rewritten and expanded with many new features.
## Official Documentation
- [Home Assistant Documentation (PR Preview)](https://deploy-preview-14877--home-assistant-docs.netlify.app/integrations/adaptive_lighting/)
- [Home Assistant Community Store (HACS)](https://hacs.xyz/)
## Community
- [Home Assistant Community Forums](https://community.home-assistant.io/)
- [Home Assistant Discord](https://discord.gg/home-assistant)
- [Reddit r/homeassistant](https://www.reddit.com/r/homeassistant/)
## Contributing
Interested in contributing to Adaptive Lighting?
- [GitHub Repository](https://github.com/basnijholt/adaptive-lighting)
- [Issue Tracker](https://github.com/basnijholt/adaptive-lighting/issues)
- [Translation via Weblate](https://hosted.weblate.org/engage/adaptive-lighting/)
### Translation
Help translate Adaptive Lighting into your language on [Hosted Weblate](https://hosted.weblate.org/engage/adaptive-lighting/). No programming knowledge required!
<a href="https://hosted.weblate.org/engage/adaptive-lighting/">
<img src="https://hosted.weblate.org/widget/adaptive-lighting/multi-auto.svg" alt="Translation status" />
</a>

201
docs/services.md Normal file
View file

@ -0,0 +1,201 @@
---
icon: lucide/zap
---
# Services
Adaptive Lighting provides three services for programmatic control, allowing you to integrate with automations and scripts.
## adaptive_lighting.apply
Applies the current Adaptive Lighting settings to lights on demand. Useful for forcing an immediate update or applying settings to lights that aren't in the regular adaptation cycle.
### Parameters
<!-- CODE:START -->
<!-- from adaptive_lighting._docs_helpers import generate_apply_markdown_table -->
<!-- print(generate_apply_markdown_table()) -->
<!-- CODE:END -->
<!-- OUTPUT:START -->
<!-- ⚠️ This content is auto-generated by `markdown-code-runner`. -->
| Service data attribute | Description | Required | Type |
|:-------------------------|:--------------------------------------------------------------------------------------|:-----------|:---------------------|
| `entity_id` | The `entity_id` of the switch with the settings to apply. 📝 | ✅ | list of `entity_id`s |
| `lights` | A light (or list of lights) to apply the settings to. 💡 | ❌ | list of `entity_id`s |
| `transition` | Duration of transition when lights change, in seconds. 🕑 | ❌ | `float` 0-6553 |
| `adapt_brightness` | Whether to adapt the brightness of the light. 🌞 | ❌ | bool |
| `adapt_color` | Whether to adapt the color on supporting lights. 🌈 | ❌ | bool |
| `prefer_rgb_color` | Whether to prefer RGB color adjustment over light color temperature when possible. 🌈 | ❌ | bool |
| `turn_on_lights` | Whether to turn on lights that are currently off. 🔆 | ❌ | bool |
<!-- OUTPUT:END -->
### Example Usage
```yaml
# Apply current settings to specific lights
service: adaptive_lighting.apply
data:
entity_id: switch.adaptive_lighting_living_room
lights:
- light.floor_lamp
- light.desk_lamp
turn_on_lights: false
```
```yaml
# Force apply with custom transition
service: adaptive_lighting.apply
data:
entity_id: switch.adaptive_lighting_bedroom
transition: 5
adapt_brightness: true
adapt_color: true
```
---
## adaptive_lighting.set_manual_control
Marks or unmarks a light as "manually controlled". When a light is marked as manually controlled, Adaptive Lighting will not adjust it until the manual control flag is cleared.
### Parameters
<!-- CODE:START -->
<!-- from adaptive_lighting._docs_helpers import generate_set_manual_control_markdown_table -->
<!-- print(generate_set_manual_control_markdown_table()) -->
<!-- CODE:END -->
<!-- OUTPUT:START -->
<!-- ⚠️ This content is auto-generated by `markdown-code-runner`. -->
| Service data attribute | Description | Required | Type |
|:-------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------|:-----------------------------------------|
| `entity_id` | The `entity_id` of the switch in which to (un)mark the light as being `manually controlled`. 📝 | ✅ | list of `entity_id`s |
| `lights` | entity_id(s) of lights, if not specified, all lights in the switch are selected. 💡 | ❌ | list of `entity_id`s |
| `manual_control` | Whether to add ("true") or remove ("false") all adapted attributes of the light from the "manual_control" list, or the name of an attribute for selective addition. 🔒 | ❌ | bool or one of `['brightness', 'color']` |
<!-- OUTPUT:END -->
### Example Usage
```yaml
# Remove manual control from a light (resume adaptation)
service: adaptive_lighting.set_manual_control
data:
entity_id: switch.adaptive_lighting_living_room
lights:
- light.floor_lamp
manual_control: false
```
```yaml
# Mark a light as manually controlled (pause adaptation)
service: adaptive_lighting.set_manual_control
data:
entity_id: switch.adaptive_lighting_living_room
lights:
- light.floor_lamp
manual_control: true
```
```yaml
# Only pause brightness adaptation, continue color adaptation
service: adaptive_lighting.set_manual_control
data:
entity_id: switch.adaptive_lighting_living_room
lights:
- light.floor_lamp
manual_control: brightness
```
---
## adaptive_lighting.change_switch_settings
<!-- CODE:START -->
<!-- from adaptive_lighting.docs_gen import _transform_readme_links -->
<!-- print(_transform_readme_links(include_section("../README.md", "change-switch-settings", strip_heading=True))) -->
<!-- CODE:END -->
<!-- OUTPUT:START -->
<!-- ⚠️ This content is auto-generated by `markdown-code-runner`. -->
`adaptive_lighting.change_switch_settings` (new in 1.7.0) Change any of the above configuration options of Adaptive Lighting (such as `sunrise_time` or `prefer_rgb_color`) with a service call directly from your script/automation.
> [!WARNING]
> These settings will **not** be written to your config and will be reset on restart of Home Assistant! You can see the current settings in the `switch.adaptive_lighting_XXX` attributes if `include_config_in_attributes` is enabled.
| Service data attribute | Required | Description |
| --------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `use_defaults` | ❌ | (default: `current` for current settings) Choose from `factory`, `configuration`, or `current` to reset variables not being set with this service call. `current` leaves them as they are, `configuration` resets to initial startup values, `factory` resets to default values listed in the documentation. |
| **all other keys** (except the ones in the table below ⚠️) | ❌ | See the table below for disallowed keys. |
The following keys are disallowed:
| **DISALLOWED** service data | Description |
| --------------------------- | ----------------------------------------------------------------------------------------------- |
| `entity_id` | You cannot change the switch's `entity_id`, as it has already been registered. |
| `lights` | You may call `adaptive_lighting.apply` with your lights or create a new config instead. |
| `name` | You can rename your switch's display name in Home Assistant's UI. |
| `interval` | The interval is used only once when the config loads. A config change and restart are required. |
<!-- OUTPUT:END -->
### Example Usage
```yaml
# Temporarily change color temperature range
service: adaptive_lighting.change_switch_settings
data:
entity_id: switch.adaptive_lighting_living_room
min_color_temp: 2500
max_color_temp: 4000
```
```yaml
# Override sunrise time for the day
service: adaptive_lighting.change_switch_settings
data:
entity_id: switch.adaptive_lighting_bedroom
sunrise_time: "07:00:00"
use_defaults: current
```
```yaml
# Reset to configuration defaults
service: adaptive_lighting.change_switch_settings
data:
entity_id: switch.adaptive_lighting_living_room
use_defaults: configuration
```
---
## Events
Adaptive Lighting also fires events that you can use in automations.
### adaptive_lighting.manual_control
Fired when a light is marked as "manually controlled" due to a detected manual change.
**Event Data:**
| Attribute | Description |
|-----------|-------------|
| `entity_id` | The light that was marked as manually controlled |
| `switch` | The Adaptive Lighting switch entity |
### Example Automation
```yaml
automation:
- alias: "Log manual control events"
trigger:
platform: event
event_type: adaptive_lighting.manual_control
action:
- service: notify.mobile_app
data:
title: "Adaptive Lighting"
message: "{{ trigger.event.data.entity_id }} was manually controlled"
```
See [Automation Examples](automation-examples.md) for more use cases.

106
docs/troubleshooting.md Normal file
View file

@ -0,0 +1,106 @@
---
icon: lucide/life-buoy
---
# Troubleshooting
This guide covers common issues and their solutions when using Adaptive Lighting.
## Enable Debug Logging
<!-- CODE:START -->
<!-- from adaptive_lighting.docs_gen import _transform_readme_links -->
<!-- print(_transform_readme_links(include_section("../README.md", "troubleshooting-intro", strip_heading=True))) -->
<!-- CODE:END -->
<!-- OUTPUT:START -->
<!-- ⚠️ This content is auto-generated by `markdown-code-runner`. -->
Encountering issues? Enable debug logging in your `configuration.yaml`:
```yaml
logger:
default: warning
logs:
custom_components.adaptive_lighting: debug
```
After the issue occurs, create a new issue report with the log (`/config/home-assistant.log`).
<!-- OUTPUT:END -->
## Common Problems & Solutions
<!-- CODE:START -->
<!-- from adaptive_lighting.docs_gen import _transform_readme_links -->
<!-- print(_transform_readme_links(include_section("../README.md", "common-problems", strip_heading=True))) -->
<!-- CODE:END -->
<!-- OUTPUT:START -->
<!-- ⚠️ This content is auto-generated by `markdown-code-runner`. -->
#### :bulb: Lights Not Responding or Turning On by Themselves
Adaptive Lighting sends more commands to lights than a typical human user would. If your light control network is unhealthy, you may experience:
- Laggy manual commands (e.g., turning lights on or off).
- Unresponsive lights.
- Home Assistant reporting incorrect light states, causing Adaptive Lighting to inadvertently turn lights back on.
Most issues that appear to be caused by Adaptive Lighting are actually due to unrelated problems.
Addressing these issues will significantly improve your Home Assistant experience.
In case lights are suddenly turning on by themselves, this is most likely due to the light incorrectly reporting an "on" state to Home Assistant, leading to an undesired Adaptive Lighting action.
To prevent adapting in cases *where the state of the light is suddenly "on" and only adapt if there is an associated `light.turn_on` service call*, set `detect_non_ha_changes: false`.
#### :signal_strength: WiFi Networks
Ensure your light bulbs have a strong WiFi connection. If the signal strength is less than -70dBm, the connection may be weak and prone to dropping messages.
#### :spider_web: Zigbee, Z-Wave, and Other Mesh Networks
Mesh networks typically require powered devices to act as routers, relaying messages back to the central coordinator (the radio connected to Home Assistant).
Most modern lights function as routers, very early models may not.
If devices become unresponsive or fail to respond to commands, Adaptive Lighting can exacerbate the issue.
Use network maps (available in ZHA, zigbee2mqtt, deCONZ, and ZWaveJS UI) to evaluate your network health.
Smart plugs can be an affordable way to add more routers to your network.
For most Zigbee networks, **using groups is essential for optimal performance**.
For example, if you want to use Adaptive Lighting in a hallway with six bulbs, adding each bulb individually to the Adaptive Lighting configuration could overwhelm the network with commands.
Instead, create a group in your Zigbee software (not a regular Home Assistant group) and add that single group to the Adaptive Lighting configuration.
This sends a single broadcast command to adjust all bulbs, improving response times and keeping the bulbs in sync.
As a rule of thumb, if you always control lights together (e.g., bulbs in a ceiling fixture), they should be in a Zigbee group.
Expose only the group (not individual bulbs) in Home Assistant Dashboards and external systems like Google Home or Apple HomeKit.
> :warning: **If you control lights individually, `manual_control` cannot behave correctly! If you need to control lights individually as well, use a [Home Assistant Light Group](https://www.home-assistant.io/integrations/group/).**
#### :rainbow: Light Colors Not Matching
Bulbs from different manufacturers or models may have varying color temperature specifications. For instance, if you have two Adaptive Lighting configurations—one with only Philips Hue White Ambiance bulbs and another with a mix of Philips Hue White Ambiance and Sengled bulbs—the Philips Hue bulbs may appear to have different color temperatures despite having identical settings.
To resolve this:
1. Include only bulbs of the same make and model in a single Adaptive Lighting configuration.
2. Rearrange bulbs so that different color temperatures are not visible simultaneously.
#### :bulb: Bulb-Specific Issues
These lights are known to exhibit disadvantageous behaviour due to firmware bugs, insufficient functionality, or hardware limitations:
- [Sengled Z01-A19NAE26](https://www.zigbee2mqtt.io/devices/Z01-A19NAE26.html#sengled-z01-a19nae26)
- Unexpected turn-ons: If Adaptive Lighting sends a long transition time (like the default 45 seconds), and the bulb is turned off during that time, it may turn back on after approximately 10 seconds to continue the transition command. Since the bulb is turning itself on, there will be no obvious trigger in Home Assistant or other logs indicating the cause of the light turning on. To fix this, set a much shorter `transition` time, such as 1 second.
- Heat sensitivity: Additionally, these bulbs may perform poorly in enclosed "dome" style ceiling lights, particularly when hot. While most LEDs (even non-smart ones) state in the fine print that they do not support working in enclosed fixtures, in practice, more expensive bulbs like Philips Hue generally perform better. To resolve this issue, move the problematic bulbs to open-air fixtures.
- Ikea Tradfri bulbs/drivers (and related Ikea smart light products)
- Unsupported simultaneous transition of brightness and color: When receiving such a command, they switch the brightness instantly and only transition the color. To get smooth transitions of both brightness and color, enable `separate_turn_on_commands`.
- Unresponsiveness during color transitions: No other commands are processed during an ongoing color transition, e.g., turn-off commands are ignored and lights stay on despite being reported as off to Home Assistant. The default config with long transitions thus results in long periods of unresponsiveness. To work around this, disable transitions by setting `transition` to `0`, and increase the adaptation frequency by setting `interval` to a short time, e.g., `15` seconds, to retain the impression of smooth continuous adaptations. Keeping the `initial_transition` is recommended for a smooth fade-in (lights are usually not turned off momentarily after being turned on, in which case a short period of unresponsiveness is tolerable).
<!-- OUTPUT:END -->
## Getting Help
If you're still having issues:
1. Enable debug logging and capture the relevant logs
2. Open an issue on [GitHub](https://github.com/basnijholt/adaptive-lighting/issues)
3. Include:
- Your configuration (redact sensitive info)
- Debug logs
- Home Assistant version
- Description of expected vs actual behavior

View file

@ -1,5 +1,5 @@
{
"name": "Adaptive Lighting",
"render_readme": true,
"homeassistant": "2022.11.0"
"homeassistant": "2024.12.0"
}

66
pyproject.toml Normal file
View file

@ -0,0 +1,66 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "adaptive-lighting"
version = "1.30.1"
description = "Automatically adjust brightness and color of lights based on the sun position"
readme = "README.md"
license = "Apache-2.0"
requires-python = ">=3.12"
[dependency-groups]
docs = [
"astral",
"homeassistant",
"markdown-code-runner>=2.7.0",
"markdown-gfm-admonition",
"pandas",
"shinylive",
"tabulate",
"ulid-transform",
"voluptuous",
"zensical",
]
dev = [
"mypy",
"pre-commit",
"ruff",
]
[tool.hatch.build.targets.wheel]
packages = ["custom_components/adaptive_lighting"]
[tool.ruff]
target-version = "py312"
line-length = 88
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # Pyflakes
"I", # isort
"UP", # pyupgrade
"RUF", # Ruff-specific rules
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"SIM", # flake8-simplify
]
ignore = [
"E501", # line too long (handled by formatter)
]
[tool.ruff.lint.isort]
known-first-party = ["adaptive_lighting"]
[tool.mypy]
python_version = "3.12"
warn_return_any = true
warn_unused_configs = true
ignore_missing_imports = true
[tool.pytest.ini_options]
testpaths = ["tests"]
asyncio_mode = "auto"

4
scripts/develop Normal file → Executable file
View file

@ -1,6 +1,6 @@
#!/usr/bin/env bash
set -e
set -ex
cd "$(dirname "$0")/.."
@ -17,4 +17,4 @@ fi
export PYTHONPATH="${PYTHONPATH}:${PWD}/custom_components"
# Start Home Assistant
hass --config "${PWD}/config" --debug
uv run hass --config "${PWD}/config" --debug

2
scripts/lint Normal file → Executable file
View file

@ -4,4 +4,4 @@ set -e
cd "$(dirname "$0")/.."
pre-commit run --all-files
uv run pre-commit run --all-files

View file

@ -2,15 +2,44 @@
set -ex
cd "$(dirname "$0")/.."
pip install -r core/requirements.txt
# Remove mypy-dev from requirements_test.txt since the maintainer deletes old versions from PyPI.
# We'll install the latest version separately below.
# See: https://github.com/cdce8p/mypy-dev/issues/62
sed -i '/^mypy-dev/d' core/requirements_test.txt
if grep -q 'codecov' core/requirements_test.txt; then
# Older HA versions still have `codecov` in `requirements_test.txt`
# however it is removed from PyPI, so we cannot install it
sed -i '/codecov/d' core/requirements_test.txt
uv pip install -r core/requirements.txt
uv pip install -r core/requirements_test.txt
# HA 2026.4+ imports aiohasupervisor from tests/components/conftest.py
# but pins it in requirements_test_all.txt instead of requirements_test.txt.
aiohasupervisor_req=""
if [[ -f core/requirements_test_all.txt ]]; then
aiohasupervisor_req="$(grep -m1 '^aiohasupervisor' core/requirements_test_all.txt || true)"
fi
if [[ -n "${aiohasupervisor_req}" ]]; then
uv pip install "${aiohasupervisor_req}"
fi
pip install -r core/requirements_test.txt
pip install -e core/
pip install ulid-transform # this is in Adaptive-lighting's manifest.json
pip install $(python test_dependencies.py)
# HA 2026.4+ validates service translations through translations/en.json.
# The core checkout keeps English source strings in strings.json, so seed en.json
# in the temporary CI checkout before tests load integrations.
for strings_file in core/homeassistant/components/*/strings.json; do
[[ -f "${strings_file}" ]] || continue
translations_dir="$(dirname "${strings_file}")/translations"
en_translation="${translations_dir}/en.json"
if [[ ! -f "${en_translation}" ]]; then
mkdir -p "${translations_dir}"
cp "${strings_file}" "${en_translation}"
fi
done
uv pip install -e core/
uv pip install ulid-transform # this is in Adaptive-lighting's manifest.json
uv pip install $(python test_dependencies.py)
# Install the latest mypy-dev (not pinned since old versions get deleted from PyPI)
uv pip install --upgrade mypy-dev
# Workaround for aiodns/pycares compatibility issue
# See: https://github.com/aio-libs/aiodns/issues/214
uv pip install --upgrade aiodns

View file

@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -e
set -ex
cd "$(dirname "$0")/.."
# Clone only if the folder doesn't exist
@ -8,10 +8,14 @@ if [[ ! -d "core" ]]; then
fi
pip install \
colorlog==6.7.0 \
pip>=21.0,<23.2 \
ruff==0.0.265
colorlog \
pip \
ruff \
uv
pip cache purge
uv venv --clear --python 3.14.2
./scripts/setup-dependencies
./scripts/setup-symlinks
pre-commit install-hooks
uv run pre-commit install-hooks

View file

@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -ex
cd "$(dirname "$0")/.."
uv sync --group docs
uv pip install -e .
uv run python docs/run_markdown_code_runner.py
uv run python .github/update-services.py
uv run python .github/update-strings.py

151
scripts/update-test-matrix.py Executable file
View file

@ -0,0 +1,151 @@
#!/usr/bin/env python3
"""Update the pytest workflow matrix with latest HA Core versions.
This script fetches the latest Home Assistant Core release versions from GitHub
and updates the pytest workflow matrix to test against them.
Usage:
python scripts/update-test-matrix.py
"""
from __future__ import annotations
import json
import re
import urllib.request
from pathlib import Path
# Minimum HA Core version to include in the test matrix
# This should be the oldest version we want to support
MIN_VERSION = (2024, 12)
def get_ha_core_versions() -> list[str]:
"""Fetch latest stable HA Core versions from GitHub API."""
all_tags = []
page = 1
# Paginate through all tags to ensure we get older versions too
while True:
url = f"https://api.github.com/repos/home-assistant/core/tags?per_page=100&page={page}"
with urllib.request.urlopen(url) as response: # noqa: S310
tags = json.loads(response.read().decode())
if not tags:
break
all_tags.extend(tags)
# Check if we've gone far enough back
# Stop if we've found versions older than our minimum
oldest_in_page = None
for t in tags:
if re.match(r"^\d+\.\d+\.\d+$", t["name"]):
parts = t["name"].split(".")
year, month = int(parts[0]), int(parts[1])
if oldest_in_page is None or (year, month) < oldest_in_page:
oldest_in_page = (year, month)
if oldest_in_page and oldest_in_page < MIN_VERSION:
break
page += 1
if page > 10: # Safety limit
break
# Filter to stable releases only (no beta/rc)
stable_pattern = re.compile(r"^\d+\.\d+\.\d+$")
versions = [t["name"] for t in all_tags if stable_pattern.match(t["name"])]
# Group by minor version and get latest patch for each
latest: dict[str, str] = {}
for version in versions:
parts = version.split(".")
year, month = int(parts[0]), int(parts[1])
# Only include versions >= MIN_VERSION
if (year, month) >= MIN_VERSION:
minor_key = f"{parts[0]}.{parts[1]}"
# Keep the one with highest patch number
if minor_key not in latest:
latest[minor_key] = version
else:
current_patch = int(latest[minor_key].split(".")[2])
new_patch = int(parts[2])
if new_patch > current_patch:
latest[minor_key] = version
# Sort by version
return sorted(latest.values(), key=lambda v: [int(x) for x in v.split(".")])
def get_python_version(ha_version: str) -> str:
"""Determine Python version based on HA Core version."""
parts = ha_version.split(".")
year, month = int(parts[0]), int(parts[1])
# 2024.x and 2025.1 use Python 3.12.
# 2025.2 through 2026.2 use Python 3.13.
# 2026.3+ uses Python 3.14.
if year == 2024 or (year == 2025 and month == 1):
return "3.12"
if year > 2026 or (year == 2026 and month >= 3):
return "3.14.2"
return "3.13"
def generate_matrix_yaml(versions: list[str]) -> str:
"""Generate the YAML matrix include block."""
lines = []
for version in versions:
python_ver = get_python_version(version)
lines.append(f' - core-version: "{version}"')
lines.append(f' python-version: "{python_ver}"')
# Add dev version
lines.append(' - core-version: "dev"')
lines.append(' python-version: "3.14.2"')
return "\n".join(lines)
def update_workflow_file(workflow_path: Path, new_matrix: str) -> bool:
"""Update the workflow file with new matrix. Returns True if changed."""
content = workflow_path.read_text()
# Pattern to match the matrix include block
# Matches from "include:" to just before " steps:"
pattern = re.compile(
r"( include:\n)(.*?)( steps:)",
re.DOTALL,
)
def replacer(match: re.Match) -> str:
return f"{match.group(1)}{new_matrix}\n{match.group(3)}"
new_content = pattern.sub(replacer, content)
if new_content == content:
return False
workflow_path.write_text(new_content)
return True
def main() -> None:
"""Main entry point."""
print("Fetching latest HA Core versions...") # noqa: T201
versions = get_ha_core_versions()
print(f"Found {len(versions)} versions: {', '.join(versions)}") # noqa: T201
print("\nGenerating matrix...") # noqa: T201
matrix = generate_matrix_yaml(versions)
print(matrix) # noqa: T201
workflow_path = Path(__file__).parent.parent / ".github/workflows/pytest.yaml"
print(f"\nUpdating {workflow_path}...") # noqa: T201
if update_workflow_file(workflow_path, matrix):
print("Workflow updated successfully!") # noqa: T201
else:
print("No changes needed.") # noqa: T201
if __name__ == "__main__":
main()

View file

@ -3,7 +3,23 @@
To run the tests, check out the [CI configuration](../.github/workflows/pytest.yml) to see how they are executed in the CI pipeline.
Alternatively, you can use the provided Docker image to run the tests locally or run them with VS Code directly in the dev container.
To run the tests using the Docker image, navigate to the `adaptive-lighting` repo folder and execute the following command:
## Prerequisites
Before running tests with Docker, you need a local Home Assistant core checkout with symlinks:
```bash
# Clone HA core (one-time setup)
git clone --depth 1 https://github.com/home-assistant/core.git core
# Setup symlinks (one-time setup)
./scripts/setup-symlinks
```
## Running tests with Docker
Navigate to the `adaptive-lighting` repo folder and execute the following command.
**Important:** Mount the entire repo (`-v $(pwd):/app`), not individual directories, or the symlinks will break.
Linux / MacOS / Windows PowerShell:
```bash
@ -20,7 +36,7 @@ This command will download the Docker image from [the adaptive-lighting Docker H
If you prefer to build the image yourself, use the following command:
```bash
docker build -t basnijholt/adaptive-lighting:latest --no-cache .
docker build -t basnijholt/adaptive-lighting:latest --no-cache --progress=plain .
```
This might be necessary if the image on Docker Hub is outdated or if the [`test_dependencies.py`](../test_dependencies.py) file is updated.

26
tests/conftest.py Normal file
View file

@ -0,0 +1,26 @@
"""Pytest configuration for adaptive-lighting tests."""
from unittest.mock import patch
import pytest
@pytest.fixture(autouse=True)
def mock_template_deprecation_issue():
"""Mock the template deprecation issue creation.
The template component's legacy platform syntax creates deprecation
issues that require translations. Since adaptive-lighting tests use
template lights as test fixtures (not testing the template integration
itself), we mock the issue creation to avoid translation validation errors.
"""
# Patch the create_legacy_template_issue function in the template helpers
# to be a no-op when called for the deprecated_legacy_templates issue
try:
with patch(
"homeassistant.components.template.helpers.create_legacy_template_issue",
):
yield
except (ImportError, ModuleNotFoundError, AttributeError):
# Older HA versions don't have this function
yield

View file

@ -4,16 +4,26 @@ from unittest.mock import Mock
import pytest
from homeassistant.components.adaptive_lighting.adaptation_utils import (
LightControlAttributes,
ServiceData,
_create_service_call_data_iterator,
_has_relevant_service_data_attributes,
_remove_redundant_attributes,
_split_service_call_data,
get_light_control_attributes,
has_brightness_attribute,
has_color_attribute,
has_effect_attribute,
manual_control_event_attribute_to_flags,
prepare_adaptation_data,
)
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_BRIGHTNESS_PCT,
ATTR_COLOR_TEMP_KELVIN,
ATTR_EFFECT,
ATTR_FLASH,
ATTR_HS_COLOR,
ATTR_TRANSITION,
)
from homeassistant.const import ATTR_ENTITY_ID, STATE_ON
@ -338,3 +348,135 @@ def fixture_hass_states_mock():
hass = Mock()
hass.states.get.return_value = Mock(attributes={ATTR_BRIGHTNESS: 10})
return hass
@pytest.mark.parametrize(
("attribute", "expected_str", "has_any", "has_none", "has_all"),
[
(LightControlAttributes.NONE, "NONE", False, True, False),
(LightControlAttributes.BRIGHTNESS, "BRIGHTNESS", True, False, False),
(LightControlAttributes.COLOR, "COLOR", True, False, False),
(
LightControlAttributes.BRIGHTNESS | LightControlAttributes.COLOR,
"BRIGHTNESS|COLOR",
True,
False,
True,
),
(
LightControlAttributes.ALL,
"BRIGHTNESS|COLOR",
True,
False,
True,
),
],
)
def test_light_control_attribute_flags(
attribute: LightControlAttributes,
expected_str: str,
has_any: bool,
has_none: bool,
has_all: bool,
):
"""Test helper methods and string conversion for the light attribute flag."""
assert str(attribute) == expected_str
assert attribute.has_any() is has_any
assert attribute.has_none() is has_none
assert attribute.has_all() is has_all
@pytest.mark.parametrize(
("manual_control_attribute", "expected_flag"),
[
(True, LightControlAttributes.ALL),
(False, LightControlAttributes.NONE),
("brightness", LightControlAttributes.BRIGHTNESS),
("color", LightControlAttributes.COLOR),
("unsupported", LightControlAttributes.NONE),
],
)
def test_manual_control_event_attribute_to_flags(
manual_control_attribute: bool | str,
expected_flag: LightControlAttributes,
):
"""Test mapping of manual control events to attribute flags."""
assert (
manual_control_event_attribute_to_flags(manual_control_attribute)
== expected_flag
)
@pytest.mark.parametrize(
("service_data", "expected"),
[
({ATTR_BRIGHTNESS: 125}, True),
({ATTR_BRIGHTNESS_PCT: 50}, True),
({ATTR_BRIGHTNESS_PCT: 50, ATTR_COLOR_TEMP_KELVIN: 3500}, True),
({ATTR_BRIGHTNESS_PCT: 50, "unknown": "foo"}, True),
({ATTR_COLOR_TEMP_KELVIN: 3500}, False),
({}, False),
],
)
def test_has_brightness_attribute(service_data: ServiceData, expected: bool):
"""Test detection of brightness attributes in service data."""
assert has_brightness_attribute(service_data) is expected
@pytest.mark.parametrize(
("service_data", "expected"),
[
({ATTR_HS_COLOR: (10, 20)}, True),
({ATTR_COLOR_TEMP_KELVIN: 5000}, True),
({ATTR_COLOR_TEMP_KELVIN: 5000, ATTR_BRIGHTNESS: 125}, True),
({ATTR_COLOR_TEMP_KELVIN: 5000, "unknown": "foo"}, True),
({ATTR_BRIGHTNESS: 125}, False),
({}, False),
],
)
def test_has_color_attribute(service_data: ServiceData, expected: bool):
"""Test detection of color attributes in service data."""
assert has_color_attribute(service_data) is expected
@pytest.mark.parametrize(
("service_data", "expected"),
[
({ATTR_EFFECT: "colorloop"}, True),
({ATTR_FLASH: "short"}, True),
({ATTR_EFFECT: "colorloop", ATTR_FLASH: "short"}, True),
({ATTR_EFFECT: "colorloop", "unknown": "foo"}, True),
({}, False),
],
)
def test_has_effect_attribute(service_data: ServiceData, expected: bool):
"""Test detection of effect attributes in service data."""
assert has_effect_attribute(service_data) is expected
@pytest.mark.parametrize(
("service_data", "expected_flags"),
[
({ATTR_BRIGHTNESS: 1}, LightControlAttributes.BRIGHTNESS),
({ATTR_HS_COLOR: (1, 2)}, LightControlAttributes.COLOR),
(
{ATTR_BRIGHTNESS: 1, ATTR_HS_COLOR: (1, 2)},
LightControlAttributes.BRIGHTNESS | LightControlAttributes.COLOR,
),
(
{ATTR_EFFECT: "colorloop"},
LightControlAttributes.BRIGHTNESS | LightControlAttributes.COLOR,
),
(
{ATTR_FLASH: "short"},
LightControlAttributes.BRIGHTNESS | LightControlAttributes.COLOR,
),
({}, LightControlAttributes.NONE),
],
)
def test_get_light_control_attributes(
service_data: ServiceData,
expected_flags: LightControlAttributes,
):
"""Test determination of light control attributes."""
assert get_light_control_attributes(service_data) == expected_flags

View file

@ -5,8 +5,7 @@ import pytest
from astral import LocationInfo
from astral.location import Location
from homeassistant.components.adaptive_lighting.color_and_brightness import (
SUN_EVENT_NOON,
SUN_EVENT_SUNRISE,
SunEvent,
SunEvents,
)
@ -167,7 +166,7 @@ def test_sun_events(tzinfo_and_location):
date = dt.datetime(2022, 1, 1)
events = sun_events.sun_events(date)
assert len(events) == 4
assert (SUN_EVENT_SUNRISE, location.sunrise(date).timestamp()) in events
assert (SunEvent.SUNRISE, location.sunrise(date).timestamp()) in events
def test_prev_and_next_events(tzinfo_and_location):
@ -186,8 +185,8 @@ def test_prev_and_next_events(tzinfo_and_location):
datetime = dt.datetime(2022, 1, 1, 10, 0)
after_sunrise = sun_events.sunrise(datetime.date()) + dt.timedelta(hours=1)
prev_event, next_event = sun_events.prev_and_next_events(after_sunrise)
assert prev_event[0] == SUN_EVENT_SUNRISE
assert next_event[0] == SUN_EVENT_NOON
assert prev_event[0] == SunEvent.SUNRISE
assert next_event[0] == SunEvent.NOON
def test_closest_event(tzinfo_and_location):
@ -206,5 +205,5 @@ def test_closest_event(tzinfo_and_location):
datetime = dt.datetime(2022, 1, 1, 6, 0)
sunrise = sun_events.sunrise(datetime.date())
event_name, ts = sun_events.closest_event(sunrise)
assert event_name == SUN_EVENT_SUNRISE
assert event_name == SunEvent.SUNRISE
assert ts == location.sunrise(sunrise.date()).timestamp()

View file

@ -1,6 +1,5 @@
"""Test Adaptive Lighting config flow."""
from homeassistant import data_entry_flow
from homeassistant.components.adaptive_lighting.const import (
CONF_SUNRISE_TIME,
CONF_SUNSET_TIME,
@ -11,6 +10,7 @@ from homeassistant.components.adaptive_lighting.const import (
)
from homeassistant.config_entries import SOURCE_IMPORT
from homeassistant.const import CONF_NAME
from homeassistant.data_entry_flow import FlowResultType
from tests.common import MockConfigEntry
@ -24,7 +24,7 @@ async def test_flow_manual_configuration(hass):
context={"source": "user"},
)
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
assert result["type"] == FlowResultType.FORM
assert result["step_id"] == "user"
assert result["handler"] == "adaptive_lighting"
@ -32,7 +32,7 @@ async def test_flow_manual_configuration(hass):
result["flow_id"],
user_input={CONF_NAME: "living room"},
)
assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
assert result["type"] == FlowResultType.CREATE_ENTRY
assert result["title"] == "living room"
@ -46,7 +46,7 @@ async def test_import_success(hass):
data=data,
)
assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
assert result["type"] == FlowResultType.CREATE_ENTRY
assert result["title"] == DEFAULT_NAME
for key, value in data.items():
assert result["data"][key] == value
@ -65,7 +65,7 @@ async def test_options(hass):
await hass.config_entries.async_setup(entry.entry_id)
result = await hass.config_entries.options.async_init(entry.entry_id)
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
assert result["type"] == FlowResultType.FORM
assert result["step_id"] == "init"
data = DEFAULT_DATA.copy()
@ -75,7 +75,7 @@ async def test_options(hass):
result["flow_id"],
user_input=data,
)
assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
assert result["type"] == FlowResultType.CREATE_ENTRY
for key, value in data.items():
assert result["data"][key] == value
@ -114,8 +114,13 @@ async def test_import_twice(hass):
)
async def test_changing_options_when_using_yaml(hass):
"""Test changing options when using YAML."""
async def test_options_flow_for_yaml_import(hass):
"""Test that options flow for YAML-imported entries shows empty form.
When a config entry is imported from YAML (source=SOURCE_IMPORT),
the options flow should show an empty form since the user should
modify the YAML configuration directly, not through the UI.
"""
entry = MockConfigEntry(
domain=DOMAIN,
title=DEFAULT_NAME,
@ -125,10 +130,120 @@ async def test_changing_options_when_using_yaml(hass):
)
entry.add_to_hass(hass)
# For YAML imports, the switch setup requires the unique_id to be in
# hass.data[DOMAIN]["__yaml__"], otherwise it deletes the entry.
# This simulates what async_step_import does.
hass.data.setdefault(DOMAIN, {}).setdefault("__yaml__", set()).add(entry.unique_id)
await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
result = await hass.config_entries.options.async_init(entry.entry_id)
result = await hass.config_entries.options.async_configure(
result["flow_id"],
user_input={},
# For YAML imports, the options flow shows an empty form (data_schema=None)
# This is intentional - users should modify YAML, not UI
assert result["type"] == FlowResultType.FORM
assert result["step_id"] == "init"
assert result.get("data_schema") is None
async def test_menu_shown_when_entries_exist(hass):
"""Test that menu step is shown when existing entries exist."""
# Create an existing entry
entry = MockConfigEntry(
domain=DOMAIN,
title="existing",
data={CONF_NAME: "existing"},
options={"min_brightness": 10},
)
entry.add_to_hass(hass)
# Start a new config flow - should show menu
result = await hass.config_entries.flow.async_init(
DOMAIN,
context={"source": "user"},
)
assert result["type"] == FlowResultType.FORM
assert result["step_id"] == "menu"
async def test_menu_create_new_instance(hass):
"""Test creating a new instance through the menu."""
# Create an existing entry
entry = MockConfigEntry(
domain=DOMAIN,
title="existing",
data={CONF_NAME: "existing"},
options={"min_brightness": 10},
)
entry.add_to_hass(hass)
# Start config flow - shows menu
result = await hass.config_entries.flow.async_init(
DOMAIN,
context={"source": "user"},
)
assert result["step_id"] == "menu"
# Choose to create new instance
result = await hass.config_entries.flow.async_configure(
result["flow_id"],
user_input={"action": "new"},
)
# Should show name form
assert result["type"] == FlowResultType.FORM
assert result["step_id"] == "user"
# Enter name
result = await hass.config_entries.flow.async_configure(
result["flow_id"],
user_input={CONF_NAME: "new instance"},
)
assert result["type"] == FlowResultType.CREATE_ENTRY
assert result["title"] == "new instance"
# New instance should have no options (not duplicated)
assert result["options"] == {}
async def test_menu_duplicate_instance(hass):
"""Test duplicating an existing instance through the menu."""
# Create an existing entry with custom options
source_options = {"min_brightness": 20, "max_brightness": 80}
entry = MockConfigEntry(
domain=DOMAIN,
title="source",
data={CONF_NAME: "source"},
options=source_options,
)
entry.add_to_hass(hass)
# Start config flow - shows menu
result = await hass.config_entries.flow.async_init(
DOMAIN,
context={"source": "user"},
)
assert result["step_id"] == "menu"
# Choose to duplicate existing entry
result = await hass.config_entries.flow.async_configure(
result["flow_id"],
user_input={"action": entry.entry_id},
)
# Should show name form
assert result["type"] == FlowResultType.FORM
assert result["step_id"] == "user"
# Enter name for duplicated instance
result = await hass.config_entries.flow.async_configure(
result["flow_id"],
user_input={CONF_NAME: "duplicated"},
)
assert result["type"] == FlowResultType.CREATE_ENTRY
assert result["title"] == "duplicated"
# Duplicated instance should have copied options
assert result["options"] == source_options

File diff suppressed because it is too large Load diff

6079
uv.lock generated Normal file

File diff suppressed because it is too large Load diff

10
webapp/README.md Normal file
View file

@ -0,0 +1,10 @@
To run this app locally, install the requirements and run `shiny run`.
```
$ cd webapp
$ pip install -r requirements-dev.txt
$ shiny run
```
After the server starts, which should take only a moment, you can open
[http://127.0.0.1:8000](http://127.0.0.1:8000) to see the interface.

1
webapp/__init__.py Normal file
View file

@ -0,0 +1 @@
"""Shiny webapp for Adaptive Lighting."""

View file

@ -217,10 +217,9 @@ Dive into the simulator, experiment with different settings, and fine-tune the b
# Shiny UI
app_ui = ui.page_fluid(
shinyswatch.theme.sandstone(),
ui.panel_title("🌞 Adaptive Lighting Simulator WebApp 🌛"),
ui.layout_sidebar(
ui.panel_sidebar(
ui.sidebar(
ui.input_switch("adapt_until_sleep", "adapt_until_sleep", value=False),
ui.input_switch("sleep_mode", "sleep_mode", value=False),
ui.input_slider("min_brightness", "min_brightness", 1, 100, 30, post="%"),
@ -277,13 +276,12 @@ app_ui = ui.page_fluid(
post=" hr",
),
),
ui.panel_main(
ui.markdown(desc_top),
ui.output_plot(id="brightness_plot"),
ui.output_plot(id="color_temp_plot"),
ui.markdown(desc_bottom),
),
ui.markdown(desc_top),
ui.output_plot(id="brightness_plot"),
ui.output_plot(id="color_temp_plot"),
ui.markdown(desc_bottom),
),
theme=shinyswatch.theme.sandstone,
)

View file

@ -0,0 +1,516 @@
"""Switch for the Adaptive Lighting integration."""
from __future__ import annotations
import bisect
import colorsys
import datetime
import logging
import math
from dataclasses import dataclass
from datetime import UTC, timedelta
from functools import cached_property, partial
from typing import TYPE_CHECKING, Any, Literal, cast
from homeassistant_util_color import (
color_RGB_to_xy,
color_temperature_to_rgb,
color_xy_to_hs,
)
if TYPE_CHECKING:
import astral.location
# Same as homeassistant.const.SUN_EVENT_SUNRISE and homeassistant.const.SUN_EVENT_SUNSET
# We re-define them here to not depend on homeassistant in this file.
SUN_EVENT_SUNRISE = "sunrise"
SUN_EVENT_SUNSET = "sunset"
SUN_EVENT_NOON = "solar_noon"
SUN_EVENT_MIDNIGHT = "solar_midnight"
_ORDER = (SUN_EVENT_SUNRISE, SUN_EVENT_NOON, SUN_EVENT_SUNSET, SUN_EVENT_MIDNIGHT)
_ALLOWED_ORDERS = {_ORDER[i:] + _ORDER[:i] for i in range(len(_ORDER))}
utcnow: partial[datetime.datetime] = partial(datetime.datetime.now, UTC)
utcnow.__doc__ = "Get now in UTC time."
_LOGGER = logging.getLogger(__name__)
@dataclass(frozen=True)
class SunEvents:
"""Track the state of the sun and associated light settings."""
name: str
astral_location: astral.location.Location
sunrise_time: datetime.time | None
min_sunrise_time: datetime.time | None
max_sunrise_time: datetime.time | None
sunset_time: datetime.time | None
min_sunset_time: datetime.time | None
max_sunset_time: datetime.time | None
sunrise_offset: datetime.timedelta = datetime.timedelta()
sunset_offset: datetime.timedelta = datetime.timedelta()
timezone: datetime.tzinfo = UTC
def sunrise(self, dt: datetime.date) -> datetime.datetime:
"""Return the (adjusted) sunrise time for the given datetime."""
sunrise = (
self.astral_location.sunrise(dt, local=False)
if self.sunrise_time is None
else self._replace_time(dt, self.sunrise_time)
) + self.sunrise_offset
if self.min_sunrise_time is not None:
min_sunrise = self._replace_time(dt, self.min_sunrise_time)
sunrise = max(min_sunrise, sunrise)
if self.max_sunrise_time is not None:
max_sunrise = self._replace_time(dt, self.max_sunrise_time)
sunrise = min(max_sunrise, sunrise)
return sunrise
def sunset(self, dt: datetime.date) -> datetime.datetime:
"""Return the (adjusted) sunset time for the given datetime."""
sunset = (
self.astral_location.sunset(dt, local=False)
if self.sunset_time is None
else self._replace_time(dt, self.sunset_time)
) + self.sunset_offset
if self.min_sunset_time is not None:
min_sunset = self._replace_time(dt, self.min_sunset_time)
sunset = max(min_sunset, sunset)
if self.max_sunset_time is not None:
max_sunset = self._replace_time(dt, self.max_sunset_time)
sunset = min(max_sunset, sunset)
return sunset
def _replace_time(
self,
dt: datetime.date,
time: datetime.time,
) -> datetime.datetime:
date_time = datetime.datetime.combine(dt, time)
dt_with_tz = date_time.replace(tzinfo=self.timezone)
return dt_with_tz.astimezone(UTC)
def noon_and_midnight(
self,
dt: datetime.datetime,
sunset: datetime.datetime | None = None,
sunrise: datetime.datetime | None = None,
) -> tuple[datetime.datetime, datetime.datetime]:
"""Return the (adjusted) noon and midnight times for the given datetime."""
if (
self.sunrise_time is None
and self.sunset_time is None
and self.min_sunrise_time is None
and self.max_sunrise_time is None
and self.min_sunset_time is None
and self.max_sunset_time is None
):
solar_noon = self.astral_location.noon(dt, local=False)
solar_midnight = self.astral_location.midnight(dt, local=False)
return solar_noon, solar_midnight
if sunset is None:
sunset = self.sunset(dt)
if sunrise is None:
sunrise = self.sunrise(dt)
middle = abs(sunset - sunrise) / 2
if sunset > sunrise:
noon = sunrise + middle
midnight = noon + timedelta(hours=12) * (1 if noon.hour < 12 else -1)
else:
midnight = sunset + middle
noon = midnight + timedelta(hours=12) * (1 if midnight.hour < 12 else -1)
return noon, midnight
def sun_events(self, dt: datetime.datetime) -> list[tuple[str, float]]:
"""Get the four sun event's timestamps at 'dt'."""
sunrise = self.sunrise(dt)
sunset = self.sunset(dt)
solar_noon, solar_midnight = self.noon_and_midnight(dt, sunset, sunrise)
events = [
(SUN_EVENT_SUNRISE, sunrise.timestamp()),
(SUN_EVENT_SUNSET, sunset.timestamp()),
(SUN_EVENT_NOON, solar_noon.timestamp()),
(SUN_EVENT_MIDNIGHT, solar_midnight.timestamp()),
]
self._validate_sun_event_order(events)
return events
def _validate_sun_event_order(self, events: list[tuple[str, float]]) -> None:
"""Check if the sun events are in the expected order."""
events = sorted(events, key=lambda x: x[1])
events_names, _ = zip(*events, strict=True)
if events_names not in _ALLOWED_ORDERS:
msg = (
f"{self.name}: The sun events {events_names} are not in the expected"
" order. The Adaptive Lighting integration will not work!"
" This might happen if your sunrise/sunset offset is too large or"
" your manually set sunrise/sunset time is past/before noon/midnight."
)
_LOGGER.error(msg)
raise ValueError(msg)
def prev_and_next_events(self, dt: datetime.datetime) -> list[tuple[str, float]]:
"""Get the previous and next sun event."""
events = [
event
for days in [-1, 0, 1]
for event in self.sun_events(dt + timedelta(days=days))
]
events = sorted(events, key=lambda x: x[1])
i_now = bisect.bisect([ts for _, ts in events], dt.timestamp())
return events[i_now - 1 : i_now + 1]
def sun_position(self, dt: datetime.datetime) -> float:
"""Calculate the position of the sun, between [-1, 1]."""
target_ts = dt.timestamp()
(_, prev_ts), (next_event, next_ts) = self.prev_and_next_events(dt)
h, x = (
(prev_ts, next_ts)
if next_event in (SUN_EVENT_SUNSET, SUN_EVENT_SUNRISE)
else (next_ts, prev_ts)
)
# k = -1 between sunset and sunrise (sun below horizon)
# k = 1 between sunrise and sunset (sun above horizon)
k = 1 if next_event in (SUN_EVENT_SUNSET, SUN_EVENT_NOON) else -1
return k * (1 - ((target_ts - h) / (h - x)) ** 2)
def closest_event(self, dt: datetime.datetime) -> tuple[str, float]:
"""Get the closest sunset or sunrise event."""
(prev_event, prev_ts), (next_event, next_ts) = self.prev_and_next_events(dt)
if SUN_EVENT_SUNRISE in (prev_event, next_event):
ts_event = prev_ts if prev_event == SUN_EVENT_SUNRISE else next_ts
return SUN_EVENT_SUNRISE, ts_event
if SUN_EVENT_SUNSET in (prev_event, next_event):
ts_event = prev_ts if prev_event == SUN_EVENT_SUNSET else next_ts
return SUN_EVENT_SUNSET, ts_event
msg = "No sunrise or sunset event found."
raise ValueError(msg)
@dataclass(frozen=True)
class SunLightSettings:
"""Track the state of the sun and associated light settings."""
name: str
astral_location: astral.location.Location
adapt_until_sleep: bool
max_brightness: int
max_color_temp: int
min_brightness: int
min_color_temp: int
sleep_brightness: int
sleep_rgb_or_color_temp: Literal["color_temp", "rgb_color"]
sleep_color_temp: int
sleep_rgb_color: tuple[int, int, int]
sunrise_time: datetime.time | None
min_sunrise_time: datetime.time | None
max_sunrise_time: datetime.time | None
sunset_time: datetime.time | None
min_sunset_time: datetime.time | None
max_sunset_time: datetime.time | None
brightness_mode_time_dark: datetime.timedelta
brightness_mode_time_light: datetime.timedelta
brightness_mode: Literal["default", "linear", "tanh"] = "default"
sunrise_offset: datetime.timedelta = datetime.timedelta()
sunset_offset: datetime.timedelta = datetime.timedelta()
timezone: datetime.tzinfo = UTC
@cached_property
def sun(self) -> SunEvents:
"""Return the SunEvents object."""
return SunEvents(
name=self.name,
astral_location=self.astral_location,
sunrise_time=self.sunrise_time,
sunrise_offset=self.sunrise_offset,
min_sunrise_time=self.min_sunrise_time,
max_sunrise_time=self.max_sunrise_time,
sunset_time=self.sunset_time,
sunset_offset=self.sunset_offset,
min_sunset_time=self.min_sunset_time,
max_sunset_time=self.max_sunset_time,
timezone=self.timezone,
)
def _brightness_pct_default(self, dt: datetime.datetime) -> float:
"""Calculate the brightness percentage using the default method."""
sun_position = self.sun.sun_position(dt)
if sun_position > 0:
return self.max_brightness
delta_brightness = self.max_brightness - self.min_brightness
return (delta_brightness * (1 + sun_position)) + self.min_brightness
def _brightness_pct_tanh(self, dt: datetime.datetime) -> float:
event, ts_event = self.sun.closest_event(dt)
dark = self.brightness_mode_time_dark.total_seconds()
light = self.brightness_mode_time_light.total_seconds()
if event == SUN_EVENT_SUNRISE:
brightness = scaled_tanh(
dt.timestamp() - ts_event,
x1=-dark,
x2=+light,
y1=0.05, # be at 5% of range at x1
y2=0.95, # be at 95% of range at x2
y_min=self.min_brightness,
y_max=self.max_brightness,
)
elif event == SUN_EVENT_SUNSET:
brightness = scaled_tanh(
dt.timestamp() - ts_event,
x1=-light, # shifted timestamp for the start of sunset
x2=+dark, # shifted timestamp for the end of sunset
y1=0.95, # be at 95% of range at the start of sunset
y2=0.05, # be at 5% of range at the end of sunset
y_min=self.min_brightness,
y_max=self.max_brightness,
)
return clamp(brightness, self.min_brightness, self.max_brightness)
def _brightness_pct_linear(self, dt: datetime.datetime) -> float:
event, ts_event = self.sun.closest_event(dt)
# at ts_event - dt_start, brightness == start_brightness
# at ts_event + dt_end, brightness == end_brightness
dark = self.brightness_mode_time_dark.total_seconds()
light = self.brightness_mode_time_light.total_seconds()
if event == SUN_EVENT_SUNRISE:
brightness = lerp(
dt.timestamp() - ts_event,
x1=-dark,
x2=+light,
y1=self.min_brightness,
y2=self.max_brightness,
)
elif event == SUN_EVENT_SUNSET:
brightness = lerp(
dt.timestamp() - ts_event,
x1=-light,
x2=+dark,
y1=self.max_brightness,
y2=self.min_brightness,
)
return clamp(brightness, self.min_brightness, self.max_brightness)
def brightness_pct(self, dt: datetime.datetime, is_sleep: bool) -> float | None:
"""Calculate the brightness in %."""
if is_sleep:
return self.sleep_brightness
assert self.brightness_mode in ("default", "linear", "tanh")
if self.brightness_mode == "default":
return self._brightness_pct_default(dt)
if self.brightness_mode == "linear":
return self._brightness_pct_linear(dt)
if self.brightness_mode == "tanh":
return self._brightness_pct_tanh(dt)
return None
def color_temp_kelvin(self, sun_position: float) -> int:
"""Calculate the color temperature in Kelvin."""
if sun_position > 0:
delta = self.max_color_temp - self.min_color_temp
ct = (delta * sun_position) + self.min_color_temp
return 5 * round(ct / 5) # round to nearest 5
if sun_position == 0 or not self.adapt_until_sleep:
return self.min_color_temp
if self.adapt_until_sleep and sun_position < 0:
delta = abs(self.min_color_temp - self.sleep_color_temp)
ct = (delta * abs(1 + sun_position)) + self.sleep_color_temp
return 5 * round(ct / 5) # round to nearest 5
msg = "Should not happen"
raise ValueError(msg)
def brightness_and_color(
self,
dt: datetime.datetime,
is_sleep: bool,
) -> dict[str, Any]:
"""Calculate the brightness and color."""
sun_position = self.sun.sun_position(dt)
rgb_color: tuple[int, int, int]
# Variable `force_rgb_color` is needed for RGB color after sunset (if enabled)
force_rgb_color = False
brightness_pct = self.brightness_pct(dt, is_sleep)
if is_sleep:
color_temp_kelvin = self.sleep_color_temp
rgb_color = self.sleep_rgb_color
elif (
self.sleep_rgb_or_color_temp == "rgb_color"
and self.adapt_until_sleep
and sun_position < 0
):
# Feature requested in
# https://github.com/basnijholt/adaptive-lighting/issues/624
# This will result in a perceptible jump in color at sunset and sunrise
# because the `color_temperature_to_rgb` function is not 100% accurate.
min_color_rgb = color_temperature_to_rgb(self.min_color_temp)
rgb_color = lerp_color_hsv(
min_color_rgb,
self.sleep_rgb_color,
sun_position,
)
color_temp_kelvin = self.color_temp_kelvin(sun_position)
force_rgb_color = True
else:
color_temp_kelvin = self.color_temp_kelvin(sun_position)
rgb_color = color_temperature_to_rgb(color_temp_kelvin)
# backwards compatibility for versions < 1.3.1 - see #403
color_temp_mired: float = math.floor(1000000 / color_temp_kelvin)
xy_color: tuple[float, float] = color_RGB_to_xy(*rgb_color)
hs_color: tuple[float, float] = color_xy_to_hs(*xy_color)
return {
"brightness_pct": brightness_pct,
"color_temp_kelvin": color_temp_kelvin,
"color_temp_mired": color_temp_mired,
"rgb_color": rgb_color,
"xy_color": xy_color,
"hs_color": hs_color,
"sun_position": sun_position,
"force_rgb_color": force_rgb_color,
}
def get_settings(
self,
is_sleep: bool,
transition: float | None,
) -> dict[str, float | int | tuple[float, float] | tuple[float, float, float]]:
"""Get all light settings.
Calculating all values takes <0.5ms.
"""
dt = utcnow() + timedelta(seconds=transition or 0)
return self.brightness_and_color(dt, is_sleep)
def find_a_b(x1: float, x2: float, y1: float, y2: float) -> tuple[float, float]:
"""Compute the values of 'a' and 'b' for a scaled and shifted tanh function.
Given two points (x1, y1) and (x2, y2), this function calculates the coefficients 'a' and 'b'
for a tanh function of the form y = 0.5 * (tanh(a * (x - b)) + 1) that passes through these points.
The derivation is as follows:
1. Start with the equation of the tanh function:
y = 0.5 * (tanh(a * (x - b)) + 1)
2. Rearrange the equation to isolate tanh:
tanh(a * (x - b)) = 2*y - 1
3. Take the inverse tanh (or artanh) on both sides to solve for 'a' and 'b':
a * (x - b) = artanh(2*y - 1)
4. Plug in the points (x1, y1) and (x2, y2) to get two equations.
Using these, we can solve for 'a' and 'b' as:
a = (artanh(2*y2 - 1) - artanh(2*y1 - 1)) / (x2 - x1)
b = x1 - (artanh(2*y1 - 1) / a)
Parameters
----------
x1
x-coordinate of the first point.
x2
x-coordinate of the second point.
y1
y-coordinate of the first point (should be between 0 and 1).
y2
y-coordinate of the second point (should be between 0 and 1).
Returns
-------
a
Coefficient 'a' for the tanh function.
b
Coefficient 'b' for the tanh function.
Notes
-----
The values of y1 and y2 should lie between 0 and 1, inclusive.
"""
a = (math.atanh(2 * y2 - 1) - math.atanh(2 * y1 - 1)) / (x2 - x1)
b = x1 - (math.atanh(2 * y1 - 1) / a)
return a, b
def scaled_tanh(
x: float,
x1: float,
x2: float,
y1: float = 0.05,
y2: float = 0.95,
y_min: float = 0.0,
y_max: float = 100.0,
) -> float:
"""Apply a scaled and shifted tanh function to a given input.
This function represents a transformation of the tanh function that scales and shifts
the output to lie between y_min and y_max. For values of 'x' close to 'x1' and 'x2'
(used to calculate 'a' and 'b'), the output of this function will be close to 'y_min'
and 'y_max', respectively.
The equation of the function is as follows:
y = y_min + (y_max - y_min) * 0.5 * (tanh(a * (x - b)) + 1)
Parameters
----------
x
The input to the function.
x1
x-coordinate of the first point.
x2
x-coordinate of the second point.
y1
y-coordinate of the first point (should be between 0 and 1). Defaults to 0.05.
y2
y-coordinate of the second point (should be between 0 and 1). Defaults to 0.95.
y_min
The minimum value of the output range. Defaults to 0.
y_max
The maximum value of the output range. Defaults to 100.
Returns
-------
float: The output of the function, which lies in the range [y_min, y_max].
"""
a, b = find_a_b(x1, x2, y1, y2)
return y_min + (y_max - y_min) * 0.5 * (math.tanh(a * (x - b)) + 1)
def lerp_color_hsv(
rgb1: tuple[float, float, float],
rgb2: tuple[float, float, float],
t: float,
) -> tuple[int, int, int]:
"""Linearly interpolate between two RGB colors in HSV color space."""
t = abs(t)
assert 0 <= t <= 1
# Convert RGB to HSV
hsv1 = colorsys.rgb_to_hsv(*[x / 255.0 for x in rgb1])
hsv2 = colorsys.rgb_to_hsv(*[x / 255.0 for x in rgb2])
# Linear interpolation in HSV space
hsv = (
hsv1[0] + t * (hsv2[0] - hsv1[0]),
hsv1[1] + t * (hsv2[1] - hsv1[1]),
hsv1[2] + t * (hsv2[2] - hsv1[2]),
)
# Convert back to RGB
rgb = tuple(round(x * 255) for x in colorsys.hsv_to_rgb(*hsv))
assert all(0 <= x <= 255 for x in rgb), f"Invalid RGB color: {rgb}"
return cast("tuple[int, int, int]", rgb)
def lerp(x: float, x1: float, x2: float, y1: float, y2: float) -> float:
"""Linearly interpolate between two values."""
return y1 + (x - x1) * (y2 - y1) / (x2 - x1)
def clamp(value: float, minimum: float, maximum: float) -> float:
"""Clamp value between minimum and maximum."""
return max(minimum, min(value, maximum))

Some files were not shown because too many files have changed in this diff Show more