diff options
author | Livio Recchia <recchialivio@libero.it> | 2020-02-10 23:06:34 +0100 |
---|---|---|
committer | Livio Recchia <recchialivio@libero.it> | 2020-02-10 23:06:34 +0100 |
commit | 9a13903a2f7d3a65fdf15a65fb59cccd622e2066 (patch) | |
tree | 9403b7dff39eb5e5d7fa0f79efb69b496add4c4b /external/plyer/facades/compass.py | |
parent | 11cc316b74d5f3f283413a33e7693b314741aa4a (diff) | |
download | manachat-9a13903a2f7d3a65fdf15a65fb59cccd622e2066.tar.gz manachat-9a13903a2f7d3a65fdf15a65fb59cccd622e2066.tar.bz2 manachat-9a13903a2f7d3a65fdf15a65fb59cccd622e2066.tar.xz manachat-9a13903a2f7d3a65fdf15a65fb59cccd622e2066.zip |
Initial commit
Diffstat (limited to 'external/plyer/facades/compass.py')
-rw-r--r-- | external/plyer/facades/compass.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/external/plyer/facades/compass.py b/external/plyer/facades/compass.py new file mode 100644 index 0000000..aed4bbf --- /dev/null +++ b/external/plyer/facades/compass.py @@ -0,0 +1,37 @@ +class Compass(object): + '''Compass facade. + + .. versionadded:: 1.2.0 + ''' + + @property + def orientation(self): + '''Property that returns values of the current compass + (magnetic field) sensors, as a (x, y, z) tuple. + Returns (None, None, None) if no data is currently available. + ''' + return self.get_orientation() + + def enable(self): + '''Activate the compass sensor. + ''' + self._enable() + + def disable(self): + '''Disable the compass sensor. + ''' + self._disable() + + def get_orientation(self): + return self._get_orientation() + + # private + + def _enable(self): + raise NotImplementedError() + + def _disable(self): + raise NotImplementedError() + + def _get_orientation(self): + raise NotImplementedError() |