1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2026-04-17 23:33:35 +01:00

Respect auto-update setting for plug-in auto-updates (#6606)

* Respect auto-update setting for plug-in auto-updates

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Also skip auto-updating plug-ins in decorator

* Raise if auto-update flag is not set and plug-in is not up to date

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Stefan Agner
2026-03-05 09:04:33 +01:00
committed by GitHub
parent 9e0d3fe461
commit 5e1eaa9dfe
6 changed files with 88 additions and 1 deletions

View File

@@ -16,6 +16,7 @@ from supervisor.homeassistant.api import HomeAssistantAPI
from supervisor.homeassistant.const import LANDINGPAGE
from supervisor.homeassistant.core import HomeAssistantCore
from supervisor.misc.tasks import Tasks
from supervisor.plugins.dns import PluginDns
from supervisor.supervisor import Supervisor
from tests.common import MockResponse, get_fixture_path
@@ -229,6 +230,20 @@ async def test_core_backup_cleanup(tasks: Tasks, coresys: CoreSys):
assert not old_tar.exists()
@pytest.mark.usefixtures("no_job_throttle")
async def test_update_dns_skipped_when_auto_update_disabled(
tasks: Tasks, coresys: CoreSys
):
"""Test plugin auto-update task is skipped when auto update is disabled."""
await coresys.core.set_state(CoreState.RUNNING)
coresys.hardware.disk.get_disk_free_space = lambda x: 5000
coresys.updater.auto_update = False
with patch.object(PluginDns, "update") as update:
await tasks._update_dns()
update.assert_not_called()
@pytest.mark.usefixtures("tmp_supervisor_data")
async def test_update_addons_auto_update_success(
tasks: Tasks,