Enable/disable power saving mode

I want to create an app that automatically activates power saving mode. Is there any function or extension to enable/disable power saving mode?