mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-11 06:14:04 +02:00
Merge remote-tracking branch 'origin/main' into fix-test_changing_options_when_using_yaml
This commit is contained in:
commit
febe01683b
9 changed files with 35 additions and 67 deletions
|
|
@ -31,8 +31,11 @@ runs:
|
|||
uses: actions/setup-python@v5.3.0
|
||||
with:
|
||||
python-version: ${{ inputs.python-version }}
|
||||
- name: Set up UV
|
||||
uses: astral-sh/setup-uv@v6
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
uv venv --python ${{ inputs.python-version }}
|
||||
./scripts/setup-dependencies
|
||||
./scripts/setup-symlinks
|
||||
|
|
|
|||
56
.github/workflows/pytest.yaml
vendored
56
.github/workflows/pytest.yaml
vendored
|
|
@ -14,46 +14,22 @@ jobs:
|
|||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- 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.4"
|
||||
- python-version: "3.12"
|
||||
core-version: "2024.5.5"
|
||||
- python-version: "3.12"
|
||||
core-version: "2024.6.4"
|
||||
- python-version: "3.12"
|
||||
core-version: "2024.7.4"
|
||||
- python-version: "3.12"
|
||||
core-version: "2024.8.3"
|
||||
- python-version: "3.12"
|
||||
core-version: "2024.9.3"
|
||||
- python-version: "3.12"
|
||||
core-version: "2024.10.4"
|
||||
- python-version: "3.12"
|
||||
core-version: "2024.11.3"
|
||||
- python-version: "3.12"
|
||||
core-version: "2024.12.5"
|
||||
- python-version: "3.12"
|
||||
core-version: "2025.1.0b5"
|
||||
- python-version: "3.13"
|
||||
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.1"
|
||||
python-version: "3.13"
|
||||
- core-version: "dev"
|
||||
python-version: "3.13"
|
||||
steps:
|
||||
- name: Check out code from GitHub
|
||||
uses: actions/checkout@v4
|
||||
|
|
|
|||
2
.github/workflows/update-readme.yml
vendored
2
.github/workflows/update-readme.yml
vendored
|
|
@ -20,7 +20,7 @@ jobs:
|
|||
- name: Install Home Assistant
|
||||
uses: ./.github/workflows/install_dependencies
|
||||
with:
|
||||
python-version: "3.12"
|
||||
python-version: "3.13"
|
||||
|
||||
- name: Install markdown-code-runner and README code dependencies
|
||||
run: |
|
||||
|
|
|
|||
13
Dockerfile
13
Dockerfile
|
|
@ -7,13 +7,7 @@
|
|||
# Optionally build the image yourself with:
|
||||
# docker build -t basnijholt/adaptive-lighting:latest .
|
||||
|
||||
FROM python:3.13-bookworm
|
||||
|
||||
RUN apt-get update && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
||||
git \
|
||||
build-essential libssl-dev libffi-dev python3-dev \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
FROM ghcr.io/astral-sh/uv:debian
|
||||
|
||||
# Clone home-assistant/core
|
||||
RUN git clone --depth 1 --branch dev https://github.com/home-assistant/core.git /core
|
||||
|
|
@ -25,9 +19,12 @@ 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.13 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"
|
||||
|
|
|
|||
|
|
@ -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/):
|
||||
|
||||
[](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.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -ex
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
|
|
|
|||
|
|
@ -2,24 +2,13 @@
|
|||
set -ex
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
pip install uv
|
||||
uv venv
|
||||
source .venv/bin/activate
|
||||
if grep -q 'mypy-dev==1.14.0a3' core/requirements_test.txt; then
|
||||
# mypy-dev==1.14.0a3 seems to not be available anymore, HA 2024.12 is affected
|
||||
sed -i 's/mypy-dev==1.14.0a3/mypy-dev==1.14.0a7/' core/requirements_test.txt
|
||||
fi
|
||||
|
||||
uv pip install -r core/requirements.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
|
||||
fi
|
||||
|
||||
if grep -q 'mypy-dev==1.10.0a3' core/requirements_test.txt; then
|
||||
# mypy-dev==1.10.0a3 seems to not be available anymore, HA 2024.4 and 2024.5 are affected
|
||||
sed -i 's/mypy-dev==1.10.0a3/mypy-dev==1.10.0b1/' core/requirements_test.txt
|
||||
fi
|
||||
uv pip install -r core/requirements_test.txt
|
||||
|
||||
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)
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ pip install \
|
|||
pip \
|
||||
ruff
|
||||
|
||||
uv venv --python 3.13
|
||||
./scripts/setup-dependencies
|
||||
./scripts/setup-symlinks
|
||||
uv run pre-commit install-hooks
|
||||
|
|
|
|||
|
|
@ -20,7 +20,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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue