KDE 4.4 PyKDE API Reference
  • KDE's Python API
  • Overview
  • PyKDE Home
  • Sitemap
  • Contact Us
 

Battery Class Reference

from PyKDE4.solid import *

Inherits: Solid.DeviceInterface → QObject
Namespace: Solid.Battery

Detailed Description

This device interface is available on batteries.


Enumerations

BatteryType { UnknownBattery, PdaBattery, UpsBattery, PrimaryBattery, MouseBattery, KeyboardBattery, KeyboardMouseBattery, CameraBattery }
ChargeState { NoCharge, Charging, Discharging }

Signals

 chargePercentChanged (int value, QString udi)
 chargeStateChanged (int newState, QString udi)
 plugStateChanged (bool newState, QString udi)

Methods

 __init__ (self, QObject backendObject)
int chargePercent (self)
 chargePercentChanged (self, int value, QString udi)
Solid.Battery.ChargeState chargeState (self)
 chargeStateChanged (self, int newState, QString udi)
Solid.DeviceInterface.Type deviceInterfaceType (self)
bool isPlugged (self)
bool isRechargeable (self)
 plugStateChanged (self, bool newState, QString udi)
Solid.Battery.BatteryType type (self)

Method Documentation

__init__ (  self,
QObject  backendObject
)
int chargePercent (   self )

Retrieves the current charge level of the battery normalised to percent.

Returns:
the current charge level normalised to percent

chargePercentChanged (  self,
int  value,
QString  udi
)

This signal is emitted when the charge percent value of this battery has changed.

Parameters:
value  the new charge percent value of the battery
udi  the UDI of the battery with the new charge percent

Signal syntax:
QObject.connect(source, SIGNAL("chargePercentChanged(int, const const QString&)"), target_slot)
Solid.Battery.ChargeState chargeState (   self )

Retrieves the current charge state of the battery. It can be in a stable state (no charge), charging or discharging.

Returns:
the current battery charge state
See also:
Solid.Battery.ChargeState

chargeStateChanged (  self,
int  newState,
QString  udi
)

This signal is emitted when the charge state of this battery has changed.

Parameters:
newState  the new charge state of the battery, it's one of the type Solid.Battery.ChargeState

See also:
Solid.Battery.ChargeState

Parameters:
udi  the UDI of the battery with the new charge state

Signal syntax:
QObject.connect(source, SIGNAL("chargeStateChanged(int, const const QString&)"), target_slot)
Solid.DeviceInterface.Type deviceInterfaceType (   self )

Get the Solid.DeviceInterface.Type of the Battery device interface.

Returns:
the Battery device interface type
See also:
Solid.DeviceInterface.Type

bool isPlugged (   self )

Indicates if this battery is plugged.

Returns:
true if the battery is plugged, false otherwise

bool isRechargeable (   self )

Indicates if the battery is rechargeable.

Returns:
true if the battery is rechargeable, false otherwise (one time usage)

plugStateChanged (  self,
bool  newState,
QString  udi
)

This signal is emitted if the battery get plugged in/out of the battery bay.

Parameters:
newState  the new plugging state of the battery, type is boolean
udi  the UDI of the battery with the new plugging state

Signal syntax:
QObject.connect(source, SIGNAL("plugStateChanged(bool, const const QString&)"), target_slot)
Solid.Battery.BatteryType type (   self )

Retrieves the type of device holding this battery.

Returns:
the type of device holding this battery
See also:
Solid.Battery.BatteryType


Enumeration Documentation

BatteryType
Enumerator:

ChargeState
Enumerator:

  • Full Index

Modules

  • akonadi
  • dnssd
  • kdecore
  • kdeui
  • khtml
  • kio
  • knewstuff
  • kparts
  • kutils
  • nepomuk
  • phonon
  • plasma
  • polkitqt
  • solid
  • soprano
This documentation is maintained by Simon Edwards.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal