Option to enable only if charging

When I’m using the application I always have it plugged in and charging, it uses too much power to pick otherwise.

So even if it says I should go to bed, if it’s not plugged in then I’m not sleeping. If I wake up, when I unplug it I’m definitely not sleeping. And yet it’ll still mark me as sleeping.

I’ve been trying to work around this with Tasker, but it’s not working very well.

To restate, add an option that it’ll detect you’re awake until charging, that once unplugged then you’ve woken up. And if there’s an alarm due, unless it’s plugged in and charging then I wasn’t sleeping and it should ignore the alarm.

I was going to make a post for this, but I did a search, so I’m grave digging. I read through documentation and Sleep’s settings and didn’t see a place anywhere for “Start sleep tracking only if charging”

The issue I have is that I’m often working on my computer in the evening/night and my phone sits on my desk, not moving. Apparently typing on my keyboard doesn’t move the phone enough for it to think I’m awake, so it automatically starts sleep tracking. This would be great, but I’m obviously awake in this scenario. It’s almost a nightly occurrence. When I do go to sleep, I plug my phone in and put it face down on the bed next to me and it detects that I’m sleeping without a hitch.