From 50e4ff80783e30a85df1c040b9f3a0049db75be3 Mon Sep 17 00:00:00 2001 From: karwosts <32912880+karwosts@users.noreply.github.com> Date: Thu, 3 Sep 2026 12:49:10 +0800 Subject: [PATCH] Enable strict typing in collection_image (#181118) --- .strict-typing | 1 + homeassistant/components/collection_image/image.py | 2 +- .../components/collection_image/quality_scale.yaml | 2 +- mypy.ini | 10 ++++++++++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.strict-typing b/.strict-typing index 77f85ae03e7d..c7a1b604fac7 100644 --- a/.strict-typing +++ b/.strict-typing @@ -147,6 +147,7 @@ homeassistant.components.clicksend.* homeassistant.components.climate.* homeassistant.components.cloud.* homeassistant.components.co2signal.* +homeassistant.components.collection_image.* homeassistant.components.comelit.* homeassistant.components.command_line.* homeassistant.components.compit.* diff --git a/homeassistant/components/collection_image/image.py b/homeassistant/components/collection_image/image.py index 747a4b06d522..daac907bb114 100644 --- a/homeassistant/components/collection_image/image.py +++ b/homeassistant/components/collection_image/image.py @@ -109,7 +109,7 @@ class CollectionImageImageEntity(ImageEntity): self._attr_available = True await self.update_image(child.media_content_id) - async def update_image(self, image_id: str): + async def update_image(self, image_id: str) -> None: """Update the entity from the image_id.""" self._cached_image = None try: diff --git a/homeassistant/components/collection_image/quality_scale.yaml b/homeassistant/components/collection_image/quality_scale.yaml index 3911ceea5647..8d1ca9c64efc 100644 --- a/homeassistant/components/collection_image/quality_scale.yaml +++ b/homeassistant/components/collection_image/quality_scale.yaml @@ -109,4 +109,4 @@ rules: inject-websession: status: exempt comment: No external connections. - strict-typing: todo + strict-typing: done diff --git a/mypy.ini b/mypy.ini index 45920e6fcb78..55d9509291bc 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1227,6 +1227,16 @@ disallow_untyped_defs = true warn_return_any = true warn_unreachable = true +[mypy-homeassistant.components.collection_image.*] +check_untyped_defs = true +disallow_incomplete_defs = true +disallow_subclassing_any = true +disallow_untyped_calls = true +disallow_untyped_decorators = true +disallow_untyped_defs = true +warn_return_any = true +warn_unreachable = true + [mypy-homeassistant.components.comelit.*] check_untyped_defs = true disallow_incomplete_defs = true