When switching to the latest linux kernel I noticed that my T470S sometimes had issues to suspend if a Bluetooth device was connected. Looking through bugzilla I found a bug that referred to this issue which was apparently fixed already. While bug itself was not really helpful it also provided a link to small script which disconnected all Bluetooth devices during the suspend process. This script indeed fixed the issue I was seeing but had one small issue. Since it was a simple shell script bluetooth devices got disabled one after another, which more or less meant the more devices you had the longer it would take.

Just for kicks I tried to speed this up and you can find my script here. I switched to python and parallelized the device disconnects.

To install it just copy it to /usr/lib/systemd/system-sleep/, make it executable and make sure that you have installed the dependencies python-dbus and python3-gi.