diff --git a/action/action.py b/action/action.py index d290898b92d..8bd7e41e3e8 100644 --- a/action/action.py +++ b/action/action.py @@ -34,7 +34,6 @@ CATEGORIES = [ "appdaemon", "integration", - "netdaemon", "plugin", "python_script", "template", diff --git a/custom_components/hacs/base.py b/custom_components/hacs/base.py index e50f4bb2138..6e0fade7e84 100644 --- a/custom_components/hacs/base.py +++ b/custom_components/hacs/base.py @@ -120,8 +120,6 @@ class HacsConfiguration: dev: bool = False frontend_repo_url: str = "" frontend_repo: str = "" - netdaemon_path: str = "netdaemon/apps/" - netdaemon: bool = False plugin_path: str = "www/community/" python_script_path: str = "python_scripts/" python_script: bool = False @@ -142,7 +140,7 @@ def update_from_dict(self, data: dict) -> None: raise HacsException("Configuration is not valid.") for key in data: - if key == "experimental": + if key in {"experimental", "netdaemon"}: continue self.__setattr__(key, data[key]) @@ -784,14 +782,6 @@ def set_active_categories(self) -> None: if self.configuration.appdaemon: self.enable_hacs_category(HacsCategory.APPDAEMON) - if self.configuration.netdaemon: - if self.repositories.category_downloaded(HacsCategory.NETDAEMON): - self.log.warning( - "NetDaemon in HACS is deprectaded. It will stop working in the future. " - "Please remove all your current NetDaemon repositories from HACS " - "and download them manually if you want to continue using them." - ) - self.enable_hacs_category(HacsCategory.NETDAEMON) async def async_load_hacs_from_github(self, _=None) -> None: """Load HACS from GitHub.""" diff --git a/custom_components/hacs/config_flow.py b/custom_components/hacs/config_flow.py index c3ce00bef85..3cbd0a6d5e7 100644 --- a/custom_components/hacs/config_flow.py +++ b/custom_components/hacs/config_flow.py @@ -28,7 +28,6 @@ APPDAEMON, COUNTRY, DEBUG, - NETDAEMON, RELEASE_LIMIT, SIDEPANEL_ICON, SIDEPANEL_TITLE, @@ -246,7 +245,6 @@ async def async_step_user(self, user_input=None): vol.Optional(RELEASE_LIMIT, default=hacs.configuration.release_limit): int, vol.Optional(COUNTRY, default=hacs.configuration.country): vol.In(LOCALE), vol.Optional(APPDAEMON, default=hacs.configuration.appdaemon): bool, - vol.Optional(NETDAEMON, default=hacs.configuration.netdaemon): bool, vol.Optional(DEBUG, default=hacs.configuration.debug): bool, } diff --git a/custom_components/hacs/diagnostics.py b/custom_components/hacs/diagnostics.py index da1cc621252..fb88fa27444 100644 --- a/custom_components/hacs/diagnostics.py +++ b/custom_components/hacs/diagnostics.py @@ -48,7 +48,6 @@ async def async_get_config_entry_diagnostics( "country", "debug", "dev", - "netdaemon", "python_script", "release_limit", "theme", diff --git a/custom_components/hacs/enums.py b/custom_components/hacs/enums.py index f86ac7d66ba..dd947e10980 100644 --- a/custom_components/hacs/enums.py +++ b/custom_components/hacs/enums.py @@ -16,7 +16,6 @@ class HacsCategory(StrEnum): INTEGRATION = "integration" LOVELACE = "lovelace" PLUGIN = "plugin" # Kept for legacy purposes - NETDAEMON = "netdaemon" PYTHON_SCRIPT = "python_script" TEMPLATE = "template" THEME = "theme" diff --git a/custom_components/hacs/repositories/__init__.py b/custom_components/hacs/repositories/__init__.py index d72f294f625..e19ca33ec5d 100644 --- a/custom_components/hacs/repositories/__init__.py +++ b/custom_components/hacs/repositories/__init__.py @@ -6,7 +6,6 @@ from .appdaemon import HacsAppdaemonRepository from .base import HacsRepository from .integration import HacsIntegrationRepository -from .netdaemon import HacsNetdaemonRepository from .plugin import HacsPluginRepository from .python_script import HacsPythonScriptRepository from .template import HacsTemplateRepository @@ -17,7 +16,6 @@ HacsCategory.INTEGRATION: HacsIntegrationRepository, HacsCategory.PYTHON_SCRIPT: HacsPythonScriptRepository, HacsCategory.APPDAEMON: HacsAppdaemonRepository, - HacsCategory.NETDAEMON: HacsNetdaemonRepository, HacsCategory.PLUGIN: HacsPluginRepository, HacsCategory.TEMPLATE: HacsTemplateRepository, } diff --git a/custom_components/hacs/repositories/base.py b/custom_components/hacs/repositories/base.py index 02538840dd1..1d3f6bd1555 100644 --- a/custom_components/hacs/repositories/base.py +++ b/custom_components/hacs/repositories/base.py @@ -29,7 +29,7 @@ HacsRepositoryExistException, ) from ..types import DownloadableContent -from ..utils.backup import Backup, BackupNetDaemon +from ..utils.backup import Backup from ..utils.decode import decode_content from ..utils.decorator import concurrent from ..utils.file_system import async_exists, async_remove, async_remove_directory @@ -85,7 +85,6 @@ "lovelace", "media-player", "mediaplayer", - "netdaemon", "plugin", "python_script", "python-script", @@ -175,7 +174,7 @@ class RepositoryData: @property def name(self): """Return the name.""" - if self.category in ["integration", "netdaemon"]: + if self.category == "integration": return self.domain return self.full_name.split("/")[-1] @@ -934,11 +933,7 @@ async def async_install_repository(self, *, version: str | None = None, **_) -> {"repository": self.data.full_name, "progress": 40}, ) - if self.data.installed and self.data.category == "netdaemon": - persistent_directory = BackupNetDaemon(hacs=self.hacs, repository=self) - await self.hacs.hass.async_add_executor_job(persistent_directory.create) - - elif self.repository_manifest.persistent_directory: + if self.repository_manifest.persistent_directory: if await async_exists( self.hacs.hass, f"{self.content.path.local}/{self.repository_manifest.persistent_directory}", diff --git a/custom_components/hacs/repositories/netdaemon.py b/custom_components/hacs/repositories/netdaemon.py deleted file mode 100644 index 6cd4e06a80d..00000000000 --- a/custom_components/hacs/repositories/netdaemon.py +++ /dev/null @@ -1,105 +0,0 @@ -"""Class for netdaemon apps in HACS.""" - -from __future__ import annotations - -from typing import TYPE_CHECKING - -from ..enums import HacsCategory, HacsDispatchEvent -from ..exceptions import HacsException -from ..utils import filters -from ..utils.decorator import concurrent -from .base import HacsRepository - -if TYPE_CHECKING: - from ..base import HacsBase - - -class HacsNetdaemonRepository(HacsRepository): - """Netdaemon apps in HACS.""" - - def __init__(self, hacs: HacsBase, full_name: str): - """Initialize.""" - super().__init__(hacs=hacs) - self.data.full_name = full_name - self.data.full_name_lower = full_name.lower() - self.data.category = HacsCategory.NETDAEMON - self.content.path.local = self.localpath - self.content.path.remote = "apps" - - @property - def localpath(self): - """Return localpath.""" - return f"{self.hacs.core.config_path}/netdaemon/apps/{self.data.name}" - - async def validate_repository(self): - """Validate.""" - await self.common_validate() - - # Custom step 1: Validate content. - if self.repository_manifest: - if self.repository_manifest.content_in_root: - self.content.path.remote = "" - - if self.content.path.remote == "apps": - self.data.domain = filters.get_first_directory_in_directory( - self.tree, self.content.path.remote - ) - self.content.path.remote = f"apps/{self.data.name}" - - compliant = False - for treefile in self.treefiles: - if treefile.startswith(f"{self.content.path.remote}") and treefile.endswith(".cs"): - compliant = True - break - if not compliant: - raise HacsException( - f"{self.string} Repository structure for {self.ref.replace('tags/','')} is not compliant" - ) - - # Handle potential errors - if self.validate.errors: - for error in self.validate.errors: - if not self.hacs.status.startup: - self.logger.error("%s %s", self.string, error) - return self.validate.success - - @concurrent(concurrenttasks=10, backoff_time=5) - async def update_repository(self, ignore_issues=False, force=False): - """Update.""" - if not await self.common_update(ignore_issues, force) and not force: - return - - # Get appdaemon objects. - if self.repository_manifest: - if self.repository_manifest.content_in_root: - self.content.path.remote = "" - - if self.content.path.remote == "apps": - self.data.domain = filters.get_first_directory_in_directory( - self.tree, self.content.path.remote - ) - self.content.path.remote = f"apps/{self.data.name}" - - # Set local path - self.content.path.local = self.localpath - - # Signal frontend to refresh - if self.data.installed: - self.hacs.async_dispatch( - HacsDispatchEvent.REPOSITORY, - { - "id": 1337, - "action": "update", - "repository": self.data.full_name, - "repository_id": self.data.id, - }, - ) - - async def async_post_installation(self): - """Run post installation steps.""" - try: - await self.hacs.hass.services.async_call( - "hassio", "addon_restart", {"addon": "c6a2317c_netdaemon"} - ) - except BaseException: # lgtm [py/catch-base-exception] pylint: disable=broad-except - pass diff --git a/custom_components/hacs/translations/en.json b/custom_components/hacs/translations/en.json index adefdae5b90..15453e270c5 100644 --- a/custom_components/hacs/translations/en.json +++ b/custom_components/hacs/translations/en.json @@ -47,7 +47,6 @@ "release_limit": "Number of releases to show", "debug": "Enable debug", "appdaemon": "Enable AppDaemon apps discovery & tracking", - "netdaemon": "[DEPRECATED] Enable NetDaemon apps discovery & tracking", "sidepanel_icon": "Side panel icon", "sidepanel_title": "Side panel title" } diff --git a/custom_components/hacs/utils/backup.py b/custom_components/hacs/utils/backup.py index a460caa8654..cf4bd11d1f9 100644 --- a/custom_components/hacs/utils/backup.py +++ b/custom_components/hacs/utils/backup.py @@ -108,33 +108,3 @@ def cleanup(self) -> None: while os.path.exists(self.backup_path): sleep(0.1) self.hacs.log.debug("Backup dir %s cleared", self.backup_path) - - -class BackupNetDaemon(Backup): - """BackupNetDaemon.""" - - def create(self) -> None: - """Create a backup in /tmp""" - if not self._init_backup_dir(): - return - - for filename in os.listdir(self.repository.content.path.local): - if not filename.endswith(".yaml"): - continue - - source_file_name = f"{self.repository.content.path.local}/{filename}" - target_file_name = f"{self.backup_path}/{filename}" - shutil.copyfile(source_file_name, target_file_name) - - def restore(self) -> None: - """Create a backup in /tmp""" - if not os.path.exists(self.backup_path): - return - - for filename in os.listdir(self.backup_path): - if not filename.endswith(".yaml"): - continue - - source_file_name = f"{self.backup_path}/{filename}" - target_file_name = f"{self.repository.content.path.local}/{filename}" - shutil.copyfile(source_file_name, target_file_name) diff --git a/custom_components/hacs/utils/configuration_schema.py b/custom_components/hacs/utils/configuration_schema.py index 8ecada63e48..c0e69234893 100644 --- a/custom_components/hacs/utils/configuration_schema.py +++ b/custom_components/hacs/utils/configuration_schema.py @@ -4,7 +4,6 @@ SIDEPANEL_TITLE = "sidepanel_title" SIDEPANEL_ICON = "sidepanel_icon" APPDAEMON = "appdaemon" -NETDAEMON = "netdaemon" # Options: COUNTRY = "country" diff --git a/custom_components/hacs/utils/path.py b/custom_components/hacs/utils/path.py index a609c020517..7994a8dcc66 100644 --- a/custom_components/hacs/utils/path.py +++ b/custom_components/hacs/utils/path.py @@ -14,7 +14,6 @@ def _get_safe_paths( config_path: str, appdaemon_path: str, - netdaemon_path: str, plugin_path: str, python_script_path: str, theme_path: str, @@ -22,7 +21,6 @@ def _get_safe_paths( """Get safe paths.""" return { Path(f"{config_path}/{appdaemon_path}").as_posix(), - Path(f"{config_path}/{netdaemon_path}").as_posix(), Path(f"{config_path}/{plugin_path}").as_posix(), Path(f"{config_path}/{python_script_path}").as_posix(), Path(f"{config_path}/{theme_path}").as_posix(), @@ -37,7 +35,6 @@ def is_safe(hacs: HacsBase, path: str | Path) -> bool: return Path(path).as_posix() not in _get_safe_paths( hacs.core.config_path, configuration.appdaemon_path, - configuration.netdaemon_path, configuration.plugin_path, configuration.python_script_path, configuration.theme_path, diff --git a/custom_components/hacs/utils/validate.py b/custom_components/hacs/utils/validate.py index 554bea055e5..6ddd4197921 100644 --- a/custom_components/hacs/utils/validate.py +++ b/custom_components/hacs/utils/validate.py @@ -133,15 +133,9 @@ def validate_version(data: Any) -> Any: vol.Required("manifest_name"): str, } -V2_NETDAEMON_DATA_JSON_SCHEMA = { - **V2_COMMON_DATA_JSON_SCHEMA, - vol.Required("domain"): str, -} - _V2_REPO_SCHEMAS = { "appdaemon": V2_COMMON_DATA_JSON_SCHEMA, "integration": V2_INTEGRATION_DATA_JSON_SCHEMA, - "netdaemon": V2_NETDAEMON_DATA_JSON_SCHEMA, "plugin": V2_COMMON_DATA_JSON_SCHEMA, "python_script": V2_COMMON_DATA_JSON_SCHEMA, "template": V2_COMMON_DATA_JSON_SCHEMA, diff --git a/tests/conftest.py b/tests/conftest.py index 0947a2263d9..5406e63e9f0 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -36,7 +36,6 @@ from custom_components.hacs.repositories import ( HacsAppdaemonRepository, HacsIntegrationRepository, - HacsNetdaemonRepository, HacsPluginRepository, HacsPythonScriptRepository, HacsTemplateRepository, @@ -222,13 +221,6 @@ def repository_appdaemon(hacs): yield dummy_repository_base(hacs, repository_obj) -@pytest.fixture -def repository_netdaemon(hacs): - """Fixtrue for HACS netdaemon repository object""" - repository_obj = HacsNetdaemonRepository(hacs, "test/test") - yield dummy_repository_base(hacs, repository_obj) - - class SnapshotFixture(Snapshot): async def assert_hacs_data( self, @@ -370,7 +362,6 @@ async def setup_integration(hass: HomeAssistant, check_report_issue: None) -> No config_entry = create_config_entry( options={ "appdaemon": True, - "netdaemon": True, } ) await common_setup_integration(hass, config_entry) diff --git a/tests/fixtures/v2-netdaemon-data.json b/tests/fixtures/v2-netdaemon-data.json deleted file mode 100644 index e217aaae0ef..00000000000 --- a/tests/fixtures/v2-netdaemon-data.json +++ /dev/null @@ -1 +0,0 @@ -{"452021391":{"manifest":{"name":"Notify on Update"},"description":"Creates a notification in Home Assistant if there is an update available","domain":"NotifyOnUpdate","etag_repository":"W/\"5eeb08f23e200216eb22986f4d63b43bf22aabb7b587472916dd12ea7baaf257\"","full_name":"ElVit/netdaemon-notify-on-update","last_commit":"3f7af27","last_updated":"2023-02-03T21:45:08Z","last_version":"v1.4.0","stargazers_count":3,"topics":["csharp","netdaemonv3"],"last_fetched":1675462323.462149},"299431188":{"manifest":{"name":"Home Assistant to ITach Wifi2IR"},"description":"ITach Wifi2IR daemon - send commands to IR operated devices","domain":"Wifi2IrApp","etag_repository":"W/\"e323aa9e7ce0c6ce029cb15ca05f1e40be1f39b2866dc9d7c8792fd9f7473142\"","full_name":"LiranSX/NetDaemon-ITach-Wifi2IR","last_commit":"0bda03e","last_updated":"2020-09-29T22:45:11Z","stargazers_count":3,"topics":["automation","csharp","itach","wifi2ir"],"last_fetched":1674291581.422214},"245832290":{"manifest":{"name":"HACS Update Notifications"},"description":"Create a notification when there is an update available in HACS","domain":"HacsNotifyOnUpdate","etag_repository":"W/\"b3d99775e1e9873629a35a759a86c77ad16bda7d75e6686e00cdffb0cc966a6b\"","full_name":"hacs/ND-NotifyUpdates","last_updated":"2020-10-30T23:55:11Z","last_version":"0.1.2","stargazers_count":9,"topics":["automation"],"last_fetched":1673600692.068567},"247953716":{"manifest":{"name":"Motion Snapshots to Discord"},"description":"Takes snapshots of your cameras and sends to discord","domain":"MotionSnapshot","etag_repository":"W/\"f213b3665803a8c12e0547298d00a145da60cd7922460cbb1084722e21504bcb\"","full_name":"isabellaalstrom/ND-MotionSnapshot","last_updated":"2020-07-31T06:41:24Z","last_version":"0.0.1","stargazers_count":3,"topics":["automation","camera","cameras","discord","security","snapshot"],"last_fetched":1673600692.068573}} \ No newline at end of file diff --git a/tests/hacsbase/test_backup.py b/tests/hacsbase/test_backup.py index a0ce53a74a4..75edf7fc29b 100644 --- a/tests/hacsbase/test_backup.py +++ b/tests/hacsbase/test_backup.py @@ -2,7 +2,7 @@ # pylint: disable=missing-docstring import os -from custom_components.hacs.utils.backup import Backup, BackupNetDaemon +from custom_components.hacs.utils.backup import Backup def test_file(hacs, tmpdir): @@ -42,31 +42,3 @@ def test_muilti(hacs, tmpdir): backup = Backup(hacs=hacs, local_path=f"{tmpdir.dirname}/dummy_directory") backup.create() backup.create() - - -def test_netdaemon_backup(hacs, repository_netdaemon): - repository = repository_netdaemon - repository.content.path.local = repository.localpath - os.makedirs(repository.content.path.local, exist_ok=True) - backup = BackupNetDaemon(hacs=hacs, repository=repository) - backup.cleanup() - with open(f"{repository.content.path.local}/dummy_file.yaml", "w") as dummy: - dummy.write("test: test") - with open(f"{repository.content.path.local}/dummy_file.yaml") as dummy: - content = dummy.read() - assert content == "test: test" - assert not os.path.exists(backup.backup_path) - os.makedirs(backup.backup_path, exist_ok=True) - backup.create() - assert os.path.exists(backup.backup_path) - with open(f"{repository.content.path.local}/dummy_file.yaml", "w") as dummy: - dummy.write("tests: tests") - with open(f"{repository.content.path.local}/dummy_file.yaml") as dummy: - content = dummy.read() - assert content == "tests: tests" - backup.restore() - backup.cleanup() - assert not os.path.exists(backup.backup_path) - with open(f"{repository.content.path.local}/dummy_file.yaml") as dummy: - content = dummy.read() - assert content == "test: test" diff --git a/tests/hacsbase/test_configuration.py b/tests/hacsbase/test_configuration.py index 6c3e6763501..6742c135513 100644 --- a/tests/hacsbase/test_configuration.py +++ b/tests/hacsbase/test_configuration.py @@ -24,9 +24,6 @@ def test_configuration_and_option(): assert isinstance(config.appdaemon, bool) assert not config.appdaemon - assert isinstance(config.netdaemon, bool) - assert not config.netdaemon - assert isinstance(config.python_script, bool) assert not config.python_script @@ -49,6 +46,15 @@ def test_ignore_experimental(): assert not hasattr(config, "experimental") +def test_ignore_netdaemon(): + """Test netdaemon setting is ignored.""" + config = HacsConfiguration() + assert not hasattr(config, "netdaemon") + + config.update_from_dict({"netdaemon": True}) + assert not hasattr(config, "netdaemon") + + def test_edge_update_with_none(): config = HacsConfiguration() with pytest.raises(HacsException): diff --git a/tests/helpers/download/test_gather_files_to_download.py b/tests/helpers/download/test_gather_files_to_download.py index 9b34239dfc3..d5c878800ec 100644 --- a/tests/helpers/download/test_gather_files_to_download.py +++ b/tests/helpers/download/test_gather_files_to_download.py @@ -153,27 +153,6 @@ def test_gather_content_in_root_theme(repository_theme): assert "test.yaml" in files -def test_gather_netdaemon_files_base(repository_netdaemon): - repository = repository_netdaemon - repository.tree = [ - AIOGitHubAPIRepositoryTreeContent({"path": "test.cs", "type": "blob"}, "test/test", "main"), - AIOGitHubAPIRepositoryTreeContent( - {"path": "apps/test/test.cs", "type": "blob"}, "test/test", "main" - ), - AIOGitHubAPIRepositoryTreeContent( - {"path": "apps/test/test.yaml", "type": "blob"}, "test/test", "main" - ), - AIOGitHubAPIRepositoryTreeContent( - {"path": ".github/file.file", "type": "blob"}, "test/test", "main" - ), - ] - files = [x.path for x in repository.gather_files_to_download()] - assert ".github/file.file" not in files - assert "test.cs" not in files - assert "apps/test/test.cs" in files - assert "apps/test/test.yaml" in files - - def test_gather_appdaemon_files_base(repository_appdaemon): repository = repository_appdaemon repository.tree = [ diff --git a/tests/output/proxy_calls.json b/tests/output/proxy_calls.json index bcfed001b95..1a4dc8bd92d 100644 --- a/tests/output/proxy_calls.json +++ b/tests/output/proxy_calls.json @@ -44,13 +44,6 @@ "https://api.github.com/repos/hacs/integration/git/trees/main": 1, "https://api.github.com/repos/hacs/integration/releases": 1 }, - "tests/hacsbase/test_backup.py::test_netdaemon_backup": { - "https://api.github.com/repos/hacs/integration": 1, - "https://api.github.com/repos/hacs/integration/contents/custom_components/hacs/manifest.json": 1, - "https://api.github.com/repos/hacs/integration/contents/hacs.json": 1, - "https://api.github.com/repos/hacs/integration/git/trees/main": 1, - "https://api.github.com/repos/hacs/integration/releases": 1 - }, "tests/hacsbase/test_hacs.py::test_add_remove_repository": { "https://api.github.com/repos/hacs/integration": 1, "https://api.github.com/repos/hacs/integration/contents/custom_components/hacs/manifest.json": 1, @@ -114,13 +107,6 @@ "https://api.github.com/repos/hacs/integration/git/trees/main": 1, "https://api.github.com/repos/hacs/integration/releases": 1 }, - "tests/helpers/download/test_gather_files_to_download.py::test_gather_netdaemon_files_base": { - "https://api.github.com/repos/hacs/integration": 1, - "https://api.github.com/repos/hacs/integration/contents/custom_components/hacs/manifest.json": 1, - "https://api.github.com/repos/hacs/integration/contents/hacs.json": 1, - "https://api.github.com/repos/hacs/integration/git/trees/main": 1, - "https://api.github.com/repos/hacs/integration/releases": 1 - }, "tests/helpers/download/test_gather_files_to_download.py::test_gather_plugin_different_card_name": { "https://api.github.com/repos/hacs/integration": 1, "https://api.github.com/repos/hacs/integration/contents/custom_components/hacs/manifest.json": 1, diff --git a/tests/snapshots/diagnostics/base.json b/tests/snapshots/diagnostics/base.json index 9a19b1dec8a..54bc37666a4 100644 --- a/tests/snapshots/diagnostics/base.json +++ b/tests/snapshots/diagnostics/base.json @@ -7,8 +7,7 @@ "disabled_by": null, "domain": "hacs", "options": { - "appdaemon": true, - "netdaemon": true + "appdaemon": true }, "pref_disable_new_entities": false, "pref_disable_polling": false, @@ -32,7 +31,6 @@ "country": "ALL", "debug": false, "dev": true, - "netdaemon": true, "python_script": false, "release_limit": 5, "theme": false diff --git a/tests/snapshots/diagnostics/exception.json b/tests/snapshots/diagnostics/exception.json index 80c5cb4a96a..df561fbb519 100644 --- a/tests/snapshots/diagnostics/exception.json +++ b/tests/snapshots/diagnostics/exception.json @@ -7,8 +7,7 @@ "disabled_by": null, "domain": "hacs", "options": { - "appdaemon": true, - "netdaemon": true + "appdaemon": true }, "pref_disable_new_entities": false, "pref_disable_polling": false, @@ -32,7 +31,6 @@ "country": "ALL", "debug": false, "dev": true, - "netdaemon": true, "python_script": false, "release_limit": 5, "theme": false diff --git a/tests/test_config_flow.py b/tests/test_config_flow.py index 5ed1e7bad18..2e33f013f3e 100644 --- a/tests/test_config_flow.py +++ b/tests/test_config_flow.py @@ -67,7 +67,8 @@ async def json(**kwargs): response_mocker.add( url="https://github.com/login/oauth/access_token", - response=MockedResponse(json=json, headers={"Content-Type": "application/json"}, keep=True), + response=MockedResponse( + json=json, headers={"Content-Type": "application/json"}, keep=True), ) result = await hass.config_entries.flow.async_init( @@ -110,7 +111,8 @@ async def json(**kwargs): assert result["type"] == FlowResultType.CREATE_ENTRY snapshots.assert_match( - safe_json_dumps(recursive_remove_key(result, ("flow_id", "minor_version"))), + safe_json_dumps(recursive_remove_key( + result, ("flow_id", "minor_version"))), "config_flow/test_full_user_flow_implementation.json", ) @@ -144,7 +146,8 @@ async def json(**kwargs): response_mocker.add( url="https://github.com/login/oauth/access_token", - response=MockedResponse(json=json, headers={"Content-Type": "application/json"}, keep=True), + response=MockedResponse( + json=json, headers={"Content-Type": "application/json"}, keep=True), ) result = await hass.config_entries.flow.async_init( @@ -191,7 +194,8 @@ async def test_flow_with_registration_failure( """Test flow with registration failure of the device.""" response_mocker.add( url="https://github.com/login/device/code", - response=MockedResponse(exception=GitHubException("Registration failed")), + response=MockedResponse( + exception=GitHubException("Registration failed")), ) result = await hass.config_entries.flow.async_init( @@ -216,7 +220,8 @@ async def test_flow_with_registration_failure( assert result["type"] == FlowResultType.ABORT snapshots.assert_match( - safe_json_dumps(recursive_remove_key(result, ("flow_id", "minor_version"))), + safe_json_dumps(recursive_remove_key( + result, ("flow_id", "minor_version"))), "config_flow/test_flow_with_registration_failure.json", ) @@ -259,7 +264,8 @@ async def json(**kwargs): response_mocker.add( url="https://github.com/login/oauth/access_token", - response=MockedResponse(json=json, headers={"Content-Type": "application/json"}, keep=True), + response=MockedResponse( + json=json, headers={"Content-Type": "application/json"}, keep=True), ) result = await hass.config_entries.flow.async_init( @@ -291,7 +297,8 @@ async def json(**kwargs): assert result["type"] == FlowResultType.ABORT snapshots.assert_match( - safe_json_dumps(recursive_remove_key(result, ("flow_id", "minor_version"))), + safe_json_dumps(recursive_remove_key( + result, ("flow_id", "minor_version"))), "config_flow/test_flow_with_activation_failure.json", ) @@ -314,7 +321,8 @@ async def test_already_configured( assert result["type"] == FlowResultType.ABORT snapshots.assert_match( - safe_json_dumps(recursive_remove_key(result, ("flow_id", "minor_version"))), + safe_json_dumps(recursive_remove_key( + result, ("flow_id", "minor_version"))), "config_flow/test_already_configured.json", ) @@ -344,7 +352,6 @@ async def test_options_flow(hass: HomeAssistant, setup_integration: Generator) - "country": "ALL", "debug": False, "experimental": True, - "netdaemon": True, "release_limit": 5, "sidepanel_icon": "hacs:hacs", "sidepanel_title": "new_title", @@ -355,7 +362,6 @@ async def test_options_flow(hass: HomeAssistant, setup_integration: Generator) - "country": "ALL", "debug": False, "experimental": True, - "netdaemon": True, "release_limit": 5, "sidepanel_icon": "hacs:hacs", "sidepanel_title": "new_title", diff --git a/tests/utils/test_validate.py b/tests/utils/test_validate.py index 82a778902db..a43acf44d96 100644 --- a/tests/utils/test_validate.py +++ b/tests/utils/test_validate.py @@ -181,7 +181,6 @@ def test_critical_repo_data_json_schema_bad_data(data: dict, expectation_1, expe [ "appdaemon", "integration", - "netdaemon", "plugin", "python_script", "template",