mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-10-08 02:17:22 +02:00
Bump to 1.27.0 for fixes in 2025.12 (#1293)
This commit is contained in:
parent
af5a7151aa
commit
e8af7a485e
6 changed files with 70 additions and 3 deletions
26
tests/conftest.py
Normal file
26
tests/conftest.py
Normal 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
|
||||
|
|
@ -82,7 +82,16 @@ from homeassistant.components.light import (
|
|||
)
|
||||
from homeassistant.components.light import DOMAIN as LIGHT_DOMAIN
|
||||
from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN
|
||||
from homeassistant.components.template.light import LightTemplate
|
||||
|
||||
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.config_entries import ConfigEntryState
|
||||
from homeassistant.const import (
|
||||
ATTR_AREA_ID,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue