From 047f523694063acb941b58b48966a92b3480fd19 Mon Sep 17 00:00:00 2001 From: dajiaohuang Date: Mon, 5 Oct 2026 14:58:20 +0800 Subject: [PATCH 1/3] docs: replace expired Home Assistant docs preview link --- docs/see-also.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/see-also.md b/docs/see-also.md index 5b06fcae..b9c96b34 100644 --- a/docs/see-also.md +++ b/docs/see-also.md @@ -45,9 +45,9 @@ The simulator lets you: 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 +## Documentation -- [Home Assistant Documentation (PR Preview)](https://deploy-preview-14877--home-assistant-docs.netlify.app/integrations/adaptive_lighting/) +- [Adaptive Lighting Documentation](https://adaptive-lighting.nijho.lt/) - [Home Assistant Community Store (HACS)](https://hacs.xyz/) ## Community From c1bcccfaa56abea8b6bb960349fa7d53f267079b Mon Sep 17 00:00:00 2001 From: dajiaohuang Date: Mon, 5 Oct 2026 17:42:02 +0800 Subject: [PATCH 2/3] test: cover unload cleanup and document current URL --- README.md | 2 +- tests/test_init.py | 25 ++++++++++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4f1bac64..bc733135 100644 --- a/README.md +++ b/README.md @@ -731,7 +731,7 @@ Use `min_sunrise_time`, `max_sunrise_time`, `min_sunset_time`, or `max_sunset_ti ## Additional Information -For more details on adding the integration and setting options, refer to the [documentation of the PR](https://deploy-preview-14877--home-assistant-docs.netlify.app/integrations/adaptive_lighting/) and [this video tutorial on Reddit](https://www.reddit.com/r/homeassistant/comments/jabhso/ha_has_it_before_apple_has_even_finished_it_i/). +For more details on adding the integration and setting options, refer to the [Adaptive Lighting documentation](https://adaptive-lighting.nijho.lt/) and [this video tutorial on Reddit](https://www.reddit.com/r/homeassistant/comments/jabhso/ha_has_it_before_apple_has_even_finished_it_i/). Adaptive Lighting was initially inspired by @claytonjn's [hass-circadian\_lighting](https://github.com/claytonjn/hass-circadian_lighting), but has since been entirely rewritten and expanded with new features. diff --git a/tests/test_init.py b/tests/test_init.py index aaf23851..68b56f1a 100644 --- a/tests/test_init.py +++ b/tests/test_init.py @@ -18,7 +18,7 @@ from homeassistant.exceptions import ServiceValidationError from homeassistant.helpers import service from homeassistant.setup import async_setup_component -from tests.common import MockConfigEntry +from tests.common import MockConfigEntry, async_mock_service async def test_setup_with_config(hass): @@ -64,6 +64,29 @@ async def test_unload_entry(hass): assert adaptive_lighting.DOMAIN not in hass.data +async def test_config_entry_updated_listener_removed_on_unload(hass): + """Test config entry updates stop reloading YAML after the entry unloads.""" + entry = MockConfigEntry( + domain=adaptive_lighting.DOMAIN, + data={CONF_NAME: DEFAULT_NAME}, + ) + entry.add_to_hass(hass) + calls = async_mock_service(hass, "homeassistant", "check_config") + + assert await hass.config_entries.async_setup(entry.entry_id) + + hass.bus.async_fire("hass.config.entry_updated", {"hass": hass}) + await hass.async_block_till_done() + assert len(calls) == 1 + + assert await hass.config_entries.async_unload(entry.entry_id) + await hass.async_block_till_done() + + hass.bus.async_fire("hass.config.entry_updated", {"hass": hass}) + await hass.async_block_till_done() + assert len(calls) == 1 + + async def test_services_survive_entry_unload_and_reload(hass): """Test integration services remain registered across entry lifecycle.""" assert await async_setup_component(hass, adaptive_lighting.DOMAIN, {}) From d93f27b898b0ea5e11132e12f7bd4d9780a3ede1 Mon Sep 17 00:00:00 2001 From: dajiaohuang Date: Mon, 5 Oct 2026 20:56:18 +0800 Subject: [PATCH 3/3] Scope documentation fix to linked issue --- tests/test_init.py | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/tests/test_init.py b/tests/test_init.py index 68b56f1a..aaf23851 100644 --- a/tests/test_init.py +++ b/tests/test_init.py @@ -18,7 +18,7 @@ from homeassistant.exceptions import ServiceValidationError from homeassistant.helpers import service from homeassistant.setup import async_setup_component -from tests.common import MockConfigEntry, async_mock_service +from tests.common import MockConfigEntry async def test_setup_with_config(hass): @@ -64,29 +64,6 @@ async def test_unload_entry(hass): assert adaptive_lighting.DOMAIN not in hass.data -async def test_config_entry_updated_listener_removed_on_unload(hass): - """Test config entry updates stop reloading YAML after the entry unloads.""" - entry = MockConfigEntry( - domain=adaptive_lighting.DOMAIN, - data={CONF_NAME: DEFAULT_NAME}, - ) - entry.add_to_hass(hass) - calls = async_mock_service(hass, "homeassistant", "check_config") - - assert await hass.config_entries.async_setup(entry.entry_id) - - hass.bus.async_fire("hass.config.entry_updated", {"hass": hass}) - await hass.async_block_till_done() - assert len(calls) == 1 - - assert await hass.config_entries.async_unload(entry.entry_id) - await hass.async_block_till_done() - - hass.bus.async_fire("hass.config.entry_updated", {"hass": hass}) - await hass.async_block_till_done() - assert len(calls) == 1 - - async def test_services_survive_entry_unload_and_reload(hass): """Test integration services remain registered across entry lifecycle.""" assert await async_setup_component(hass, adaptive_lighting.DOMAIN, {})