Package sparked :: Package hardware :: Module power :: Class PowerService
[hide private]
[frames] | no frames]

Class PowerService

source code

twisted.application.service.Service --+
                                      |
                                     PowerService

A service which monitors the power state of the computer. It fires "available" and "low" events when the power state changes. On the startup of the service, these signals get fired once to ensure a valid system state.

Instance Methods [hide private]
 
__init__(self) source code
 
startService(self) source code
 
upPowerChanged(self)
Called when UPower signals that something with the power has changed.
source code
 
dkPowerChanged(self)
Called when DeviceKit signals that something with the power has changed.
source code
 
powerEvent(self, onBattery)
Called when the power state switches between running on battery and running on mains.
source code
 
lowpowerEvent(self, low)
Called when the battery state becomes critically low, or changes from critical back to normal.
source code

Inherited from twisted.application.service.Service: __getstate__, __providedBy__, disownServiceParent, privilegedStartService, setName, setServiceParent, stopService

Class Variables [hide private]

Inherited from twisted.application.service.Service: __implemented__, __provides__, name, parent, running

Method Details [hide private]

startService(self)

source code 
Overrides: twisted.application.service.Service.startService

powerEvent(self, onBattery)

source code 

Called when the power state switches between running on battery and running on mains. The 'available' field contains a flag which is True when the computer is running on mains (AC) power.

lowpowerEvent(self, low)

source code 

Called when the battery state becomes critically low, or changes from critical back to normal. When the 'low' field of the event is True, the power is critically low. Triggers a 'low' event on this module's dispatcher.