summaryrefslogtreecommitdiff
path: root/external/plyer/facades/battery.py
blob: 7cd48c7bd4d6b2841d470ae8f9b149d36a1596d1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
class Battery(object):
    '''Battery info facade.'''

    @property
    def status(self):
        '''Property that contains a dict with the following fields:
             * **isCharging** *(bool)*: Battery is charging
             * **percentage** *(float)*: Battery charge remaining

            .. warning::
                If any of the fields is not readable, it is set as
                None.
        '''
        return self.get_state()

    def get_state(self):
        return self._get_state()

    #private

    def _get_state(self):
        raise NotImplementedError()