I just noticed something I had not noticed before.  You need to save the current status and only emit an event when the status actually changes.  As the code stands now, you're going to be displaying notifications over and over again every time the battery goes from 15% to 14% to 13% and so on.  I assume you only want one notification at each level, right?