diff --git a/supervisor/addons/model.py b/supervisor/addons/model.py index 0419d95c8..c6ca928da 100644 --- a/supervisor/addons/model.py +++ b/supervisor/addons/model.py @@ -13,7 +13,6 @@ from awesomeversion import AwesomeVersion, AwesomeVersionException from ..const import ( ARCH_DEPRECATED, - ATTR_ADVANCED, ATTR_APPARMOR, ATTR_ARCH, ATTR_AUDIO, @@ -255,8 +254,10 @@ class AddonModel(JobGroup, ABC): @property def advanced(self) -> bool: - """Return advanced mode of add-on.""" - return self.data[ATTR_ADVANCED] + """Return False; advanced mode is deprecated and no longer supported.""" + # Deprecated since Supervisor 2026.03.0; always returns False and can be + # removed once that version is the minimum supported. + return False @property def stage(self) -> AddonStage: diff --git a/supervisor/addons/validate.py b/supervisor/addons/validate.py index 6a8e84b50..2f8a2a1de 100644 --- a/supervisor/addons/validate.py +++ b/supervisor/addons/validate.py @@ -192,6 +192,15 @@ def _warn_addon_config(config: dict[str, Any]): if not name: raise vol.Invalid("Invalid Add-on config!") + if ATTR_ADVANCED in config: + # Deprecated since Supervisor 2026.03.0; this field is ignored and the + # warning can be removed once that version is the minimum supported. + _LOGGER.warning( + "Add-on '%s' uses deprecated 'advanced' field in config. " + "This field is ignored by the Supervisor. Please report this to the maintainer.", + name, + ) + if config.get(ATTR_FULL_ACCESS, False) and ( config.get(ATTR_DEVICES) or config.get(ATTR_UART) diff --git a/supervisor/api/addons.py b/supervisor/api/addons.py index 9114c0f30..5fdb58e8b 100644 --- a/supervisor/api/addons.py +++ b/supervisor/api/addons.py @@ -187,7 +187,7 @@ class APIAddons(CoreSysAttributes): ATTR_NAME: addon.name, ATTR_SLUG: addon.slug, ATTR_DESCRIPTON: addon.description, - ATTR_ADVANCED: addon.advanced, + ATTR_ADVANCED: addon.advanced, # Deprecated 2026.03 ATTR_STAGE: addon.stage, ATTR_VERSION: addon.version, ATTR_VERSION_LATEST: addon.latest_version, @@ -224,7 +224,7 @@ class APIAddons(CoreSysAttributes): ATTR_DNS: addon.dns, ATTR_DESCRIPTON: addon.description, ATTR_LONG_DESCRIPTION: await addon.long_description(), - ATTR_ADVANCED: addon.advanced, + ATTR_ADVANCED: addon.advanced, # Deprecated 2026.03 ATTR_STAGE: addon.stage, ATTR_REPOSITORY: addon.repository, ATTR_VERSION_LATEST: addon.latest_version, diff --git a/tests/addons/test_addon.py b/tests/addons/test_addon.py index 020740cd0..d383e5685 100644 --- a/tests/addons/test_addon.py +++ b/tests/addons/test_addon.py @@ -18,7 +18,7 @@ from supervisor.addons.addon import Addon from supervisor.addons.const import AddonBackupMode from supervisor.addons.model import AddonModel from supervisor.config import CoreConfig -from supervisor.const import AddonBoot, AddonState, BusEvent +from supervisor.const import ATTR_ADVANCED, AddonBoot, AddonState, BusEvent from supervisor.coresys import CoreSys from supervisor.docker.addon import DockerAddon from supervisor.docker.const import ContainerState @@ -834,6 +834,14 @@ def test_auto_update_available(install_addon_example: Addon): assert install_addon_example.auto_update_available is False +@pytest.mark.usefixtures("coresys") +def test_advanced_flag_ignored(install_addon_example: Addon): + """Ensure advanced flag in config is ignored.""" + install_addon_example.data[ATTR_ADVANCED] = True + + assert install_addon_example.advanced is False + + async def test_paths_cache(coresys: CoreSys, install_addon_ssh: Addon): """Test cache for key paths that may or may not exist.""" assert not install_addon_ssh.with_logo diff --git a/tests/addons/test_config.py b/tests/addons/test_config.py index f55666f8b..2385b66c4 100644 --- a/tests/addons/test_config.py +++ b/tests/addons/test_config.py @@ -223,6 +223,16 @@ def test_warn_legacy_machine_values(caplog: pytest.LogCaptureFixture): assert "Add-on config 'machine' uses deprecated values" in caplog.text +def test_warn_advanced_deprecated(caplog: pytest.LogCaptureFixture): + """Warn when deprecated advanced field is present.""" + config = load_json_fixture("basic-addon-config.json") + config["advanced"] = True + + vd.SCHEMA_ADDON_CONFIG(config) + + assert "uses deprecated 'advanced' field in config" in caplog.text + + async def test_valid_manifest_build(): """Validate build config with manifest build from.""" config = load_json_fixture("build-config-manifest.json")