From ce95876d03dd5ee6208e069930cafdf024f03f85 Mon Sep 17 00:00:00 2001 From: Robert Resch Date: Tue, 6 May 2025 13:29:37 +0200 Subject: [PATCH] Rename S3 to AWS_S3 (#144324) --- CODEOWNERS | 4 ++-- homeassistant/brands/amazon.json | 9 ++++++++- homeassistant/components/{s3 => aws_s3}/__init__.py | 2 +- homeassistant/components/{s3 => aws_s3}/backup.py | 2 +- .../components/{s3 => aws_s3}/config_flow.py | 2 +- homeassistant/components/{s3 => aws_s3}/const.py | 4 ++-- .../components/{s3 => aws_s3}/manifest.json | 6 +++--- .../components/{s3 => aws_s3}/quality_scale.yaml | 0 homeassistant/components/{s3 => aws_s3}/strings.json | 12 ++++++------ homeassistant/generated/config_flows.py | 2 +- homeassistant/generated/integrations.json | 12 ++++++------ requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- tests/components/{s3 => aws_s3}/__init__.py | 2 +- tests/components/{s3 => aws_s3}/conftest.py | 8 ++++---- tests/components/{s3 => aws_s3}/const.py | 4 ++-- tests/components/{s3 => aws_s3}/test_backup.py | 10 +++++----- tests/components/{s3 => aws_s3}/test_config_flow.py | 4 ++-- tests/components/{s3 => aws_s3}/test_init.py | 2 +- 19 files changed, 48 insertions(+), 41 deletions(-) rename homeassistant/components/{s3 => aws_s3}/__init__.py (98%) rename homeassistant/components/{s3 => aws_s3}/backup.py (99%) rename homeassistant/components/{s3 => aws_s3}/config_flow.py (98%) rename homeassistant/components/{s3 => aws_s3}/const.py (90%) rename homeassistant/components/{s3 => aws_s3}/manifest.json (66%) rename homeassistant/components/{s3 => aws_s3}/quality_scale.yaml (100%) rename homeassistant/components/{s3 => aws_s3}/strings.json (73%) rename tests/components/{s3 => aws_s3}/__init__.py (90%) rename tests/components/{s3 => aws_s3}/conftest.py (93%) rename tests/components/{s3 => aws_s3}/const.py (78%) rename tests/components/{s3 => aws_s3}/test_backup.py (98%) rename tests/components/{s3 => aws_s3}/test_config_flow.py (96%) rename tests/components/{s3 => aws_s3}/test_init.py (98%) diff --git a/CODEOWNERS b/CODEOWNERS index 89b0cf16af0..997fd1b0981 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -171,6 +171,8 @@ build.json @home-assistant/supervisor /homeassistant/components/avea/ @pattyland /homeassistant/components/awair/ @ahayworth @danielsjf /tests/components/awair/ @ahayworth @danielsjf +/homeassistant/components/aws_s3/ @tomasbedrich +/tests/components/aws_s3/ @tomasbedrich /homeassistant/components/axis/ @Kane610 /tests/components/axis/ @Kane610 /homeassistant/components/azure_data_explorer/ @kaareseras @@ -1318,8 +1320,6 @@ build.json @home-assistant/supervisor /tests/components/ruuvitag_ble/ @akx /homeassistant/components/rympro/ @OnFreund @elad-bar @maorcc /tests/components/rympro/ @OnFreund @elad-bar @maorcc -/homeassistant/components/s3/ @tomasbedrich -/tests/components/s3/ @tomasbedrich /homeassistant/components/sabnzbd/ @shaiu @jpbede /tests/components/sabnzbd/ @shaiu @jpbede /homeassistant/components/saj/ @fredericvl diff --git a/homeassistant/brands/amazon.json b/homeassistant/brands/amazon.json index a7caea2b932..624a8a17b7d 100644 --- a/homeassistant/brands/amazon.json +++ b/homeassistant/brands/amazon.json @@ -1,5 +1,12 @@ { "domain": "amazon", "name": "Amazon", - "integrations": ["alexa", "amazon_polly", "aws", "fire_tv", "route53"] + "integrations": [ + "alexa", + "amazon_polly", + "aws", + "aws_s3", + "fire_tv", + "route53" + ] } diff --git a/homeassistant/components/s3/__init__.py b/homeassistant/components/aws_s3/__init__.py similarity index 98% rename from homeassistant/components/s3/__init__.py rename to homeassistant/components/aws_s3/__init__.py index 95e5e7d738c..b709595ae4a 100644 --- a/homeassistant/components/s3/__init__.py +++ b/homeassistant/components/aws_s3/__init__.py @@ -1,4 +1,4 @@ -"""The S3 integration.""" +"""The AWS S3 integration.""" from __future__ import annotations diff --git a/homeassistant/components/s3/backup.py b/homeassistant/components/aws_s3/backup.py similarity index 99% rename from homeassistant/components/s3/backup.py rename to homeassistant/components/aws_s3/backup.py index a58947d4c2d..7ef1289132d 100644 --- a/homeassistant/components/s3/backup.py +++ b/homeassistant/components/aws_s3/backup.py @@ -1,4 +1,4 @@ -"""Backup platform for the S3 integration.""" +"""Backup platform for the AWS S3 integration.""" from collections.abc import AsyncIterator, Callable, Coroutine import functools diff --git a/homeassistant/components/s3/config_flow.py b/homeassistant/components/aws_s3/config_flow.py similarity index 98% rename from homeassistant/components/s3/config_flow.py rename to homeassistant/components/aws_s3/config_flow.py index d721594b7bd..81ddd881f0f 100644 --- a/homeassistant/components/s3/config_flow.py +++ b/homeassistant/components/aws_s3/config_flow.py @@ -1,4 +1,4 @@ -"""Config flow for the S3 integration.""" +"""Config flow for the AWS S3 integration.""" from __future__ import annotations diff --git a/homeassistant/components/s3/const.py b/homeassistant/components/aws_s3/const.py similarity index 90% rename from homeassistant/components/s3/const.py rename to homeassistant/components/aws_s3/const.py index d992a92ac20..95d53c93a08 100644 --- a/homeassistant/components/s3/const.py +++ b/homeassistant/components/aws_s3/const.py @@ -1,11 +1,11 @@ -"""Constants for the S3 integration.""" +"""Constants for the AWS S3 integration.""" from collections.abc import Callable from typing import Final from homeassistant.util.hass_dict import HassKey -DOMAIN: Final = "s3" +DOMAIN: Final = "aws_s3" CONF_ACCESS_KEY_ID = "access_key_id" CONF_SECRET_ACCESS_KEY = "secret_access_key" diff --git a/homeassistant/components/s3/manifest.json b/homeassistant/components/aws_s3/manifest.json similarity index 66% rename from homeassistant/components/s3/manifest.json rename to homeassistant/components/aws_s3/manifest.json index 6a3026ff76d..8ab65b5883a 100644 --- a/homeassistant/components/s3/manifest.json +++ b/homeassistant/components/aws_s3/manifest.json @@ -1,9 +1,9 @@ { - "domain": "s3", - "name": "S3", + "domain": "aws_s3", + "name": "AWS S3", "codeowners": ["@tomasbedrich"], "config_flow": true, - "documentation": "https://www.home-assistant.io/integrations/s3", + "documentation": "https://www.home-assistant.io/integrations/aws_s3", "integration_type": "service", "iot_class": "cloud_push", "loggers": ["aiobotocore"], diff --git a/homeassistant/components/s3/quality_scale.yaml b/homeassistant/components/aws_s3/quality_scale.yaml similarity index 100% rename from homeassistant/components/s3/quality_scale.yaml rename to homeassistant/components/aws_s3/quality_scale.yaml diff --git a/homeassistant/components/s3/strings.json b/homeassistant/components/aws_s3/strings.json similarity index 73% rename from homeassistant/components/s3/strings.json rename to homeassistant/components/aws_s3/strings.json index 3404321be03..b5683aafa6e 100644 --- a/homeassistant/components/s3/strings.json +++ b/homeassistant/components/aws_s3/strings.json @@ -9,18 +9,18 @@ "endpoint_url": "Endpoint URL" }, "data_description": { - "access_key_id": "Access key ID to connect to S3 API", - "secret_access_key": "Secret access key to connect to S3 API", + "access_key_id": "Access key ID to connect to AWS S3 API", + "secret_access_key": "Secret access key to connect to AWS S3 API", "bucket": "Bucket must already exist and be writable by the provided credentials.", "endpoint_url": "Endpoint URL provided to [Boto3 Session]({boto3_docs_url}). Region-specific [AWS S3 endpoints]({aws_s3_docs_url}) are available in their docs." }, - "title": "Add S3 bucket" + "title": "Add AWS S3 bucket" } }, "error": { - "cannot_connect": "[%key:component::s3::exceptions::cannot_connect::message%]", - "invalid_bucket_name": "[%key:component::s3::exceptions::invalid_bucket_name::message%]", - "invalid_credentials": "[%key:component::s3::exceptions::invalid_credentials::message%]", + "cannot_connect": "[%key:component::aws_s3::exceptions::cannot_connect::message%]", + "invalid_bucket_name": "[%key:component::aws_s3::exceptions::invalid_bucket_name::message%]", + "invalid_credentials": "[%key:component::aws_s3::exceptions::invalid_credentials::message%]", "invalid_endpoint_url": "Invalid endpoint URL" }, "abort": { diff --git a/homeassistant/generated/config_flows.py b/homeassistant/generated/config_flows.py index 680d0a7bb2c..cf80105a889 100644 --- a/homeassistant/generated/config_flows.py +++ b/homeassistant/generated/config_flows.py @@ -75,6 +75,7 @@ FLOWS = { "aussie_broadband", "autarco", "awair", + "aws_s3", "axis", "azure_data_explorer", "azure_devops", @@ -541,7 +542,6 @@ FLOWS = { "ruuvi_gateway", "ruuvitag_ble", "rympro", - "s3", "sabnzbd", "samsungtv", "sanix", diff --git a/homeassistant/generated/integrations.json b/homeassistant/generated/integrations.json index 1b9e9216827..4cee3922cd4 100644 --- a/homeassistant/generated/integrations.json +++ b/homeassistant/generated/integrations.json @@ -219,6 +219,12 @@ "iot_class": "cloud_push", "name": "Amazon Web Services (AWS)" }, + "aws_s3": { + "integration_type": "service", + "config_flow": true, + "iot_class": "cloud_push", + "name": "AWS S3" + }, "fire_tv": { "integration_type": "virtual", "config_flow": false, @@ -5622,12 +5628,6 @@ "config_flow": true, "iot_class": "cloud_polling" }, - "s3": { - "name": "S3", - "integration_type": "service", - "config_flow": true, - "iot_class": "cloud_push" - }, "sabnzbd": { "name": "SABnzbd", "integration_type": "hub", diff --git a/requirements_all.txt b/requirements_all.txt index 7c253acf5b7..c9c358a5724 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -210,7 +210,7 @@ aioazuredevops==2.2.1 aiobafi6==0.9.0 # homeassistant.components.aws -# homeassistant.components.s3 +# homeassistant.components.aws_s3 aiobotocore==2.21.1 # homeassistant.components.comelit diff --git a/requirements_test_all.txt b/requirements_test_all.txt index d626ecc7b86..71d12a5cf32 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -198,7 +198,7 @@ aioazuredevops==2.2.1 aiobafi6==0.9.0 # homeassistant.components.aws -# homeassistant.components.s3 +# homeassistant.components.aws_s3 aiobotocore==2.21.1 # homeassistant.components.comelit diff --git a/tests/components/s3/__init__.py b/tests/components/aws_s3/__init__.py similarity index 90% rename from tests/components/s3/__init__.py rename to tests/components/aws_s3/__init__.py index 570747e69d0..90e4652bb2b 100644 --- a/tests/components/s3/__init__.py +++ b/tests/components/aws_s3/__init__.py @@ -1,4 +1,4 @@ -"""Tests for the S3 integration.""" +"""Tests for the AWS S3 integration.""" from homeassistant.core import HomeAssistant diff --git a/tests/components/s3/conftest.py b/tests/components/aws_s3/conftest.py similarity index 93% rename from tests/components/s3/conftest.py rename to tests/components/aws_s3/conftest.py index a2c2b9eb3dd..8f12ee17661 100644 --- a/tests/components/s3/conftest.py +++ b/tests/components/aws_s3/conftest.py @@ -1,4 +1,4 @@ -"""Common fixtures for the S3 tests.""" +"""Common fixtures for the AWS S3 tests.""" from collections.abc import AsyncIterator, Generator import json @@ -6,12 +6,12 @@ from unittest.mock import AsyncMock, patch import pytest -from homeassistant.components.backup import AgentBackup -from homeassistant.components.s3.backup import ( +from homeassistant.components.aws_s3.backup import ( MULTIPART_MIN_PART_SIZE_BYTES, suggested_filenames, ) -from homeassistant.components.s3.const import DOMAIN +from homeassistant.components.aws_s3.const import DOMAIN +from homeassistant.components.backup import AgentBackup from .const import USER_INPUT diff --git a/tests/components/s3/const.py b/tests/components/aws_s3/const.py similarity index 78% rename from tests/components/s3/const.py rename to tests/components/aws_s3/const.py index 92ebc080f2c..443275d0444 100644 --- a/tests/components/s3/const.py +++ b/tests/components/aws_s3/const.py @@ -1,6 +1,6 @@ -"""Consts for S3 tests.""" +"""Consts for AWS S3 tests.""" -from homeassistant.components.s3.const import ( +from homeassistant.components.aws_s3.const import ( CONF_ACCESS_KEY_ID, CONF_BUCKET, CONF_ENDPOINT_URL, diff --git a/tests/components/s3/test_backup.py b/tests/components/aws_s3/test_backup.py similarity index 98% rename from tests/components/s3/test_backup.py rename to tests/components/aws_s3/test_backup.py index 535e546dd21..a8b24ec1ab4 100644 --- a/tests/components/s3/test_backup.py +++ b/tests/components/aws_s3/test_backup.py @@ -1,4 +1,4 @@ -"""Test the S3 backup platform.""" +"""Test the AWS S3 backup platform.""" from collections.abc import AsyncGenerator from io import StringIO @@ -9,19 +9,19 @@ from unittest.mock import AsyncMock, Mock, patch from botocore.exceptions import ConnectTimeoutError import pytest -from homeassistant.components.backup import DOMAIN as BACKUP_DOMAIN, AgentBackup -from homeassistant.components.s3.backup import ( +from homeassistant.components.aws_s3.backup import ( MULTIPART_MIN_PART_SIZE_BYTES, BotoCoreError, S3BackupAgent, async_register_backup_agents_listener, suggested_filenames, ) -from homeassistant.components.s3.const import ( +from homeassistant.components.aws_s3.const import ( CONF_ENDPOINT_URL, DATA_BACKUP_AGENT_LISTENERS, DOMAIN, ) +from homeassistant.components.backup import DOMAIN as BACKUP_DOMAIN, AgentBackup from homeassistant.core import HomeAssistant from homeassistant.helpers.backup import async_initialize_backup from homeassistant.setup import async_setup_component @@ -362,7 +362,7 @@ async def test_agents_upload_network_failure( ) assert resp.status == 201 - assert "Upload failed for s3" in caplog.text + assert "Upload failed for aws_s3" in caplog.text async def test_agents_download( diff --git a/tests/components/s3/test_config_flow.py b/tests/components/aws_s3/test_config_flow.py similarity index 96% rename from tests/components/s3/test_config_flow.py rename to tests/components/aws_s3/test_config_flow.py index 1ea59a3aeb5..061d990140a 100644 --- a/tests/components/s3/test_config_flow.py +++ b/tests/components/aws_s3/test_config_flow.py @@ -1,4 +1,4 @@ -"""Test the S3 config flow.""" +"""Test the AWS S3 config flow.""" from unittest.mock import AsyncMock, patch @@ -10,7 +10,7 @@ from botocore.exceptions import ( import pytest from homeassistant import config_entries -from homeassistant.components.s3.const import CONF_BUCKET, CONF_ENDPOINT_URL, DOMAIN +from homeassistant.components.aws_s3.const import CONF_BUCKET, CONF_ENDPOINT_URL, DOMAIN from homeassistant.core import HomeAssistant from homeassistant.data_entry_flow import FlowResultType diff --git a/tests/components/s3/test_init.py b/tests/components/aws_s3/test_init.py similarity index 98% rename from tests/components/s3/test_init.py rename to tests/components/aws_s3/test_init.py index afa11f5cf72..ee247bfce1d 100644 --- a/tests/components/s3/test_init.py +++ b/tests/components/aws_s3/test_init.py @@ -1,4 +1,4 @@ -"""Test the s3 storage integration.""" +"""Test the AWS S3 storage integration.""" from unittest.mock import AsyncMock, patch