summaryrefslogtreecommitdiff
path: root/external/plyer/facades/gyroscope.py
diff options
context:
space:
mode:
Diffstat (limited to 'external/plyer/facades/gyroscope.py')
-rw-r--r--external/plyer/facades/gyroscope.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/external/plyer/facades/gyroscope.py b/external/plyer/facades/gyroscope.py
new file mode 100644
index 0000000..31ec1ae
--- /dev/null
+++ b/external/plyer/facades/gyroscope.py
@@ -0,0 +1,37 @@
+class Gyroscope(object):
+ '''Gyroscope facade.
+
+ .. versionadded:: 1.2.0
+ '''
+
+ @property
+ def orientation(self):
+ '''Property that returns values of the current Gyroscope 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 Gyroscope sensor.
+ '''
+ self._enable()
+
+ def disable(self):
+ '''Disable the Gyroscope 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()