From 504ed83ffbbe3ab96761e9d3f8a1fba6ecb1d455 Mon Sep 17 00:00:00 2001 From: JJ <6438760+IgnusG@users.noreply.github.com> Date: Mon, 13 Jan 2025 20:11:17 +0100 Subject: [PATCH] Add person component to strict type checking (#132754) --- .strict-typing | 1 + homeassistant/components/person/__init__.py | 2 +- mypy.ini | 10 ++++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.strict-typing b/.strict-typing index 1d5d220efc1..b83bb0f6a95 100644 --- a/.strict-typing +++ b/.strict-typing @@ -371,6 +371,7 @@ homeassistant.components.panel_custom.* homeassistant.components.peblar.* homeassistant.components.peco.* homeassistant.components.persistent_notification.* +homeassistant.components.person.* homeassistant.components.pi_hole.* homeassistant.components.ping.* homeassistant.components.plugwise.* diff --git a/homeassistant/components/person/__init__.py b/homeassistant/components/person/__init__.py index b793f4b33ae..856e07bb2ee 100644 --- a/homeassistant/components/person/__init__.py +++ b/homeassistant/components/person/__init__.py @@ -280,7 +280,7 @@ class PersonStorageCollection(collection.DictStorageCollection): return data @callback - def _get_suggested_id(self, info: dict) -> str: + def _get_suggested_id(self, info: dict[str, str]) -> str: """Suggest an ID based on the config.""" return info[CONF_NAME] diff --git a/mypy.ini b/mypy.ini index 5b6824250e2..4eb6bdff80b 100644 --- a/mypy.ini +++ b/mypy.ini @@ -3466,6 +3466,16 @@ disallow_untyped_defs = true warn_return_any = true warn_unreachable = true +[mypy-homeassistant.components.person.*] +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.pi_hole.*] check_untyped_defs = true disallow_incomplete_defs = true