Fixed bug that prevented UPower device Refresh from working. Moved state logic to independent function.