ci: support one year of Home Assistant releases (#1546)

This commit is contained in:
Bas Nijholt 2026-09-06 12:17:22 +02:00 committed by GitHub
commit a04a533f45
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 30 additions and 86 deletions

View file

@ -14,24 +14,6 @@ jobs:
fail-fast: false
matrix:
include:
- 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"
@ -46,7 +28,17 @@ jobs:
python-version: "3.13"
- core-version: "2026.3.4"
python-version: "3.14.2"
- core-version: "2026.4.3"
- core-version: "2026.4.4"
python-version: "3.14.2"
- core-version: "2026.5.4"
python-version: "3.14.2"
- core-version: "2026.6.4"
python-version: "3.14.2"
- core-version: "2026.7.4"
python-version: "3.14.2"
- core-version: "2026.8.3"
python-version: "3.14.2"
- core-version: "2026.9.1"
python-version: "3.14.2"
- core-version: "dev"
python-version: "3.14.2"

View file

@ -8,7 +8,7 @@ This guide will help you install and configure Adaptive Lighting for the first t
## Prerequisites
- [Home Assistant](https://www.home-assistant.io/) 2024.12.0 or newer
- [Home Assistant](https://www.home-assistant.io/) 2025.9.0 or newer
- [HACS](https://hacs.xyz/) (Home Assistant Community Store) installed
## Installation

View file

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

View file

@ -15,9 +15,9 @@ 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)
# Keep the latest stable release month and the preceding 12 monthly release lines.
# Update this explicit floor when dropping another supported release month.
MIN_VERSION = (2025, 9)
def get_ha_core_versions() -> list[str]:
@ -82,11 +82,8 @@ 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.
# 2025.9 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"

View file

@ -5,7 +5,6 @@ import asyncio
import contextlib
import datetime
import logging
from collections import OrderedDict
from copy import deepcopy
from random import randint
from typing import Any
@ -90,17 +89,8 @@ from homeassistant.components.light import (
)
from homeassistant.components.light import DOMAIN as LIGHT_DOMAIN
from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN
try:
# HA >= 2025.8
from homeassistant.components.template.light import (
StateLightEntity as LightTemplate,
)
except ImportError:
# HA < 2025.8
from homeassistant.components.template.light import LightTemplate
from homeassistant.components.template import light as template_light
from homeassistant.components.template.light import StateLightEntity as LightTemplate
from homeassistant.config_entries import SOURCE_IMPORT, SOURCE_USER, ConfigEntryState
from homeassistant.const import (
ATTR_AREA_ID,
@ -116,7 +106,6 @@ from homeassistant.const import (
STATE_ON,
EntityCategory,
)
from homeassistant.const import __version__ as ha_version
from homeassistant.core import Context, Event, HomeAssistant, State
from homeassistant.helpers import area_registry as ar
from homeassistant.helpers import entity_registry
@ -125,6 +114,7 @@ from homeassistant.setup import async_setup_component
from homeassistant.util.color import color_temperature_mired_to_kelvin
from tests.common import MockConfigEntry
from tests.common import mock_area_registry as mock_ha_area_registry
# HA 2026.6 removed the legacy `light: platform: template` YAML format
# (home-assistant/core#169615); use the modern `template:` format there.
@ -1854,56 +1844,21 @@ async def test_separate_turn_on_commands(hass, separate_turn_on_commands):
assert sleep_color_temp != color_temp
# Vendored in this function as it was broken
# https://github.com/home-assistant/core/pull/112150 (my PR and reported issue)
# Then removed: https://github.com/home-assistant/core/pull/112172
# Then re-added: https://github.com/home-assistant/core/pull/113453
# This version is no longer the same as the one in HA because of the many changes
# that have been made in 2024.
def mock_area_registry(
hass: HomeAssistant,
) -> ar.AreaRegistry:
"""Mock the Area Registry."""
registry = ar.AreaRegistry(hass)
registry._area_data = {}
area_kwargs = {
"name": "Test Area",
"normalized_name": "test-area",
"id": "test-area",
"picture": None,
}
year, month = (int(x) for x in ha_version.split(".")[:2])
dt = datetime.date(year, month, 1)
if dt >= datetime.date(2023, 1, 1):
area_kwargs["aliases"] = {}
if dt >= datetime.date(2024, 2, 1):
area_kwargs["icon"] = None
if dt >= datetime.date(2024, 3, 1):
area_kwargs["floor_id"] = "test-floor"
if dt >= datetime.date(2024, 11, 1):
area_kwargs.pop("normalized_name")
if dt >= datetime.date(2025, 2, 1):
area_kwargs["humidity_entity_id"] = None
area_kwargs["temperature_entity_id"] = None
# This mess... 🤯
if dt >= datetime.date(2024, 2, 1) and dt != datetime.date(2024, 4, 1):
# 2024.4 removed AreaRegistryItems and then added it back in 2024.5:
# https://github.com/home-assistant/core/pull/114777
registry.areas = ar.AreaRegistryItems()
elif dt == datetime.date(2024, 4, 1):
from homeassistant.helpers.normalized_name_base_registry import (
NormalizedNameBaseRegistryItems,
)
registry.areas = NormalizedNameBaseRegistryItems()
else:
registry.areas = OrderedDict()
area = ar.AreaEntry(**area_kwargs)
registry.areas[area.id] = area
hass.data[ar.DATA_REGISTRY] = registry
return registry
area = ar.AreaEntry(
aliases=set(),
floor_id="test-floor",
humidity_entity_id=None,
icon=None,
id="test-area",
name="Test Area",
picture=None,
temperature_entity_id=None,
)
return mock_ha_area_registry(hass, {area.id: area})
async def test_light_switch_in_specific_area(hass):