diff --git a/.strict-typing b/.strict-typing index 63b3159e8f..e3906252a0 100644 --- a/.strict-typing +++ b/.strict-typing @@ -159,8 +159,8 @@ homeassistant.components.http.* homeassistant.components.huawei_lte.* homeassistant.components.hyperion.* homeassistant.components.ibeacon.* -homeassistant.components.image.* homeassistant.components.image_processing.* +homeassistant.components.image_upload.* homeassistant.components.input_button.* homeassistant.components.input_select.* homeassistant.components.integration.* diff --git a/CODEOWNERS b/CODEOWNERS index 9c407a88fb..cbb3c0c1a3 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -529,10 +529,10 @@ build.json @home-assistant/supervisor /tests/components/icloud/ @Quentame @nzapponi /homeassistant/components/ign_sismologia/ @exxamalte /tests/components/ign_sismologia/ @exxamalte -/homeassistant/components/image/ @home-assistant/core -/tests/components/image/ @home-assistant/core /homeassistant/components/image_processing/ @home-assistant/core /tests/components/image_processing/ @home-assistant/core +/homeassistant/components/image_upload/ @home-assistant/core +/tests/components/image_upload/ @home-assistant/core /homeassistant/components/incomfort/ @zxdavb /homeassistant/components/influxdb/ @mdegat01 /tests/components/influxdb/ @mdegat01 diff --git a/homeassistant/components/image/const.py b/homeassistant/components/image/const.py deleted file mode 100644 index 5241f7ec07..0000000000 --- a/homeassistant/components/image/const.py +++ /dev/null @@ -1,3 +0,0 @@ -"""Constants for the Image integration.""" - -DOMAIN = "image" diff --git a/homeassistant/components/image/__init__.py b/homeassistant/components/image_upload/__init__.py similarity index 98% rename from homeassistant/components/image/__init__.py rename to homeassistant/components/image_upload/__init__.py index 23ab393aab..7ff69145a0 100644 --- a/homeassistant/components/image/__init__.py +++ b/homeassistant/components/image_upload/__init__.py @@ -1,4 +1,4 @@ -"""The Picture integration.""" +"""The Image Upload integration.""" from __future__ import annotations import asyncio @@ -25,7 +25,7 @@ import homeassistant.util.dt as dt_util from .const import DOMAIN _LOGGER = logging.getLogger(__name__) -STORAGE_KEY = DOMAIN +STORAGE_KEY = "image" STORAGE_VERSION = 1 VALID_SIZES = {256, 512} MAX_SIZE = 1024 * 1024 * 10 @@ -41,13 +41,13 @@ UPDATE_FIELDS = { async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up the Image integration.""" - image_dir = pathlib.Path(hass.config.path(DOMAIN)) + image_dir = pathlib.Path(hass.config.path("image")) hass.data[DOMAIN] = storage_collection = ImageStorageCollection(hass, image_dir) await storage_collection.async_load() collection.StorageCollectionWebsocket( storage_collection, - DOMAIN, - DOMAIN, + "image", + "image", CREATE_FIELDS, UPDATE_FIELDS, ).async_setup(hass, create_create=False) diff --git a/homeassistant/components/image_upload/const.py b/homeassistant/components/image_upload/const.py new file mode 100644 index 0000000000..f7607f745c --- /dev/null +++ b/homeassistant/components/image_upload/const.py @@ -0,0 +1,3 @@ +"""Constants for the Image Upload integration.""" + +DOMAIN = "image_upload" diff --git a/homeassistant/components/image/manifest.json b/homeassistant/components/image_upload/manifest.json similarity index 79% rename from homeassistant/components/image/manifest.json rename to homeassistant/components/image_upload/manifest.json index 888d6fc1fa..e8b3342d7b 100644 --- a/homeassistant/components/image/manifest.json +++ b/homeassistant/components/image_upload/manifest.json @@ -1,8 +1,8 @@ { - "domain": "image", - "name": "Image", + "domain": "image_upload", + "name": "Image Upload", "config_flow": false, - "documentation": "https://www.home-assistant.io/integrations/image", + "documentation": "https://www.home-assistant.io/integrations/image_upload", "requirements": ["pillow==9.3.0"], "dependencies": ["http"], "codeowners": ["@home-assistant/core"], diff --git a/homeassistant/components/person/manifest.json b/homeassistant/components/person/manifest.json index dc9c76ca10..671da2491e 100644 --- a/homeassistant/components/person/manifest.json +++ b/homeassistant/components/person/manifest.json @@ -2,7 +2,7 @@ "domain": "person", "name": "Person", "documentation": "https://www.home-assistant.io/integrations/person", - "dependencies": ["image"], + "dependencies": ["image_upload"], "after_dependencies": ["device_tracker"], "codeowners": [], "quality_scale": "internal", diff --git a/mypy.ini b/mypy.ini index f9db50bf38..b6c868b47a 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1344,7 +1344,7 @@ disallow_untyped_defs = true warn_return_any = true warn_unreachable = true -[mypy-homeassistant.components.image.*] +[mypy-homeassistant.components.image_processing.*] check_untyped_defs = true disallow_incomplete_defs = true disallow_subclassing_any = true @@ -1354,7 +1354,7 @@ disallow_untyped_defs = true warn_return_any = true warn_unreachable = true -[mypy-homeassistant.components.image_processing.*] +[mypy-homeassistant.components.image_upload.*] check_untyped_defs = true disallow_incomplete_defs = true disallow_subclassing_any = true diff --git a/requirements_all.txt b/requirements_all.txt index 71e2ad2740..4a30ca9be8 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1321,7 +1321,7 @@ pilight==0.1.1 # homeassistant.components.doods # homeassistant.components.generic -# homeassistant.components.image +# homeassistant.components.image_upload # homeassistant.components.proxy # homeassistant.components.qrcode # homeassistant.components.seven_segments diff --git a/requirements_test_all.txt b/requirements_test_all.txt index f03d40c3d0..a5025ee7ab 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -951,7 +951,7 @@ pilight==0.1.1 # homeassistant.components.doods # homeassistant.components.generic -# homeassistant.components.image +# homeassistant.components.image_upload # homeassistant.components.proxy # homeassistant.components.qrcode # homeassistant.components.seven_segments diff --git a/script/hassfest/manifest.py b/script/hassfest/manifest.py index 130d3288ab..5a41d71be2 100644 --- a/script/hassfest/manifest.py +++ b/script/hassfest/manifest.py @@ -62,7 +62,7 @@ NO_IOT_CLASS = [ "homeassistant_hardware", "homeassistant_sky_connect", "homeassistant_yellow", - "image", + "image_upload", "input_boolean", "input_button", "input_datetime", diff --git a/tests/components/file_upload/test_init.py b/tests/components/file_upload/test_init.py index 699fb6f9b8..ff9cca5fe4 100644 --- a/tests/components/file_upload/test_init.py +++ b/tests/components/file_upload/test_init.py @@ -9,7 +9,7 @@ from homeassistant.components import file_upload from homeassistant.core import HomeAssistant from homeassistant.setup import async_setup_component -from tests.components.image import TEST_IMAGE +from tests.components.image_upload import TEST_IMAGE @pytest.fixture diff --git a/tests/components/image/__init__.py b/tests/components/image_upload/__init__.py similarity index 61% rename from tests/components/image/__init__.py rename to tests/components/image_upload/__init__.py index b04214669a..94acd4a548 100644 --- a/tests/components/image/__init__.py +++ b/tests/components/image_upload/__init__.py @@ -1,4 +1,4 @@ -"""Tests for the Image integration.""" +"""Tests for the Image Upload integration.""" import pathlib TEST_IMAGE = pathlib.Path(__file__).parent / "logo.png" diff --git a/tests/components/image/logo.png b/tests/components/image_upload/logo.png similarity index 100% rename from tests/components/image/logo.png rename to tests/components/image_upload/logo.png diff --git a/tests/components/image/test_init.py b/tests/components/image_upload/test_init.py similarity index 97% rename from tests/components/image/test_init.py rename to tests/components/image_upload/test_init.py index d62717cb89..3bf85ac7a6 100644 --- a/tests/components/image/test_init.py +++ b/tests/components/image_upload/test_init.py @@ -19,7 +19,7 @@ async def test_upload_image(hass, hass_client, hass_ws_client): with tempfile.TemporaryDirectory() as tempdir, patch.object( hass.config, "path", return_value=tempdir ), patch("homeassistant.util.dt.utcnow", return_value=now): - assert await async_setup_component(hass, "image", {}) + assert await async_setup_component(hass, "image_upload", {}) ws_client: ClientWebSocketResponse = await hass_ws_client() client: ClientSession = await hass_client() diff --git a/tests/components/media_source/test_local_source.py b/tests/components/media_source/test_local_source.py index de36566fb5..0467244a7d 100644 --- a/tests/components/media_source/test_local_source.py +++ b/tests/components/media_source/test_local_source.py @@ -125,7 +125,7 @@ async def test_media_view(hass, hass_client): async def test_upload_view(hass, hass_client, temp_dir, hass_admin_user): """Allow uploading media.""" - img = (Path(__file__).parent.parent / "image/logo.png").read_bytes() + img = (Path(__file__).parent.parent / "image_upload/logo.png").read_bytes() def get_file(name): pic = io.BytesIO(img)