@snorrski you might want to have a look at this:
It seems to be exactly what you wanted. It works without root and on my (unrooted) S7 Edge, I can still use the fingerprint sensor to unlock my device after locking it this way (input keyevent POWER).
I know it's been over 2 years since y'all had this discussion, but I hope this still reaches you.
The power button on my Mi A1 stopped working recently and I can't seem to find it's replacement flex cable anywhere. I'm entirely new to Tasker but I have been reading for hours now to find ways to use a screen based interaction (say a double tap on the screen) to simulate the Power button to turn the screen off while still being able to unlock my phone with my fingerprint scanner.
So far, I've understood that it is doable (with an article refering to input keyevent 26), even more so on Android Pie (with another article refering to using Global_Actions) than it was previously possible, but am entirely clueless on how. I also couldn't quite understand the process of using the remote ADB shell plugin you mention here.
Could either of the two of you please share a step-by-step how-to on how to achieve the same? It would really help a lot. Thank you
Note: I'm using unrooted Mi A1 running stock Android Pie with July 1st security patch.