diff --git a/.strict-typing b/.strict-typing index 1163dea618c..041da10ab80 100644 --- a/.strict-typing +++ b/.strict-typing @@ -447,6 +447,7 @@ homeassistant.components.withings.* homeassistant.components.wiz.* homeassistant.components.wled.* homeassistant.components.worldclock.* +homeassistant.components.xiaomi_ble.* homeassistant.components.yale_smart_alarm.* homeassistant.components.yalexs_ble.* homeassistant.components.youtube.* diff --git a/homeassistant/components/xiaomi_ble/__init__.py b/homeassistant/components/xiaomi_ble/__init__.py index 228a72cb8a5..456838d1ee1 100644 --- a/homeassistant/components/xiaomi_ble/__init__.py +++ b/homeassistant/components/xiaomi_ble/__init__.py @@ -128,7 +128,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: ) ) - async def _async_poll(service_info: BluetoothServiceInfoBleak): + async def _async_poll(service_info: BluetoothServiceInfoBleak) -> SensorUpdate: # BluetoothServiceInfoBleak is defined in HA, otherwise would just pass it # directly to the Xiaomi code # Make sure the device we have is one that we can connect with diff --git a/homeassistant/components/xiaomi_ble/config_flow.py b/homeassistant/components/xiaomi_ble/config_flow.py index 9115fc5991b..bca76bfd0a5 100644 --- a/homeassistant/components/xiaomi_ble/config_flow.py +++ b/homeassistant/components/xiaomi_ble/config_flow.py @@ -280,8 +280,8 @@ class XiaomiConfigFlow(ConfigFlow, domain=DOMAIN): # Otherwise there wasn't actually encryption so abort return self.async_abort(reason="reauth_successful") - def _async_get_or_create_entry(self, bindkey=None): - data = {} + def _async_get_or_create_entry(self, bindkey: str | None = None) -> FlowResult: + data: dict[str, Any] = {} if bindkey: data["bindkey"] = bindkey diff --git a/homeassistant/components/xiaomi_ble/device_trigger.py b/homeassistant/components/xiaomi_ble/device_trigger.py index 04239cee56d..91d7132d65f 100644 --- a/homeassistant/components/xiaomi_ble/device_trigger.py +++ b/homeassistant/components/xiaomi_ble/device_trigger.py @@ -65,7 +65,7 @@ async def async_validate_trigger_config( """Validate trigger config.""" device_id = config[CONF_DEVICE_ID] if model_data := _async_trigger_model_data(hass, device_id): - return model_data.schema(config) + return model_data.schema(config) # type: ignore[no-any-return] return config diff --git a/mypy.ini b/mypy.ini index d049a922e1b..7693912a6c8 100644 --- a/mypy.ini +++ b/mypy.ini @@ -4233,6 +4233,16 @@ disallow_untyped_defs = true warn_return_any = true warn_unreachable = true +[mypy-homeassistant.components.xiaomi_ble.*] +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.yale_smart_alarm.*] check_untyped_defs = true disallow_incomplete_defs = true