Refactor DBus sleep inhibition testing and improve messages #522