File: humidity.py

package info (click to toggle)
python-plyer 2.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,808 kB
  • sloc: python: 13,395; sh: 217; makefile: 177
file content (34 lines) | stat: -rw-r--r-- 828 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
class Humidity:
    '''Humidity facade.
       Humidity sensor returns value of humidity.
       With method `enable` you can turn on Humidity sensor and
       'disable' method stops the sensor.
       Use property `tell` to get humidity value.

       Supported Platforms
       -------------------
       Android
    '''

    @property
    def tell(self):
        '''Current humidity'''
        return self._get_humidity()

    def enable(self):
        '''Enable Humidity sensor.'''
        self._enable()

    def disable(self):
        '''Disable Humidity sensor.'''
        self._disable()

    # private
    def _get_humidity(self, **kwargs):
        raise NotImplementedError()

    def _enable(self, **kwargs):
        raise NotImplementedError()

    def _disable(self, **kwargs):
        raise NotImplementedError()