Port 6 Touch SDK
Project description
Touch SDK py
Connects to Port 6 Touch SDK compatible Bluetooth devices – like this Wear OS app.
There is also a web SDK and a Unity SDK.
See port6.io/sdk for more info.
Installation
pip install touch-sdk
Example usage
from touch_sdk import Watch
class MyWatch(Watch):
def on_tap(self):
print('Tap')
watch = MyWatch()
watch.start()
Usage
All callback functions should be methods in the class that inherits Watch
, like in the example above.
An optional name string in the constructor will search only for devices with that name (case insensitive).
watch = MyWatch('fvaf')
Tap gesture
def on_tap(self):
print('tap')
Sensors
def on_sensors(self, sensors):
print(sensors.acceleration) # x, y, z
print(sensors.gravity) # x, y, z
print(sensors.angular_velocity) # x, y, z
print(sensors.orientation) # x, y, z, w
Touch screen
def on_touch_down(self, x, y):
print('touch down', x, y)
def on_touch_up(self, x, y):
print('touch up', x, y)
def on_touch_move(self, x, y):
print('touch move', x, y)
def on_touch_cancel(self, x, y):
print('touch cancel', x, y)
Rotary dial
def on_rotary(self, direction):
print('rotary', direction)
Outputs +1 for clockwise and -1 for counter-clockwise.
Back button
def on_back_button(self):
print('back button')
Called when the back button is pressed and released. Wear OS does not support separate button down and button up events for the back button.
Pylint
python3 -m pylint src --rcfile=.pylintrc
Adding pylint to pre-commit
echo 'python3 -m pylint src --rcfile=.pylintrc -sn' > .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
touch_sdk-0.1.1.tar.gz
(6.8 kB
view hashes)
Built Distribution
Close
Hashes for touch_sdk-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d672fa05ab63dc768c2a8a4fdcf0bb150ea58d14d03685c8c5d0f6e4e10614b |
|
MD5 | 1f3bc62b1393f831a6b25a3a24a9b972 |
|
BLAKE2b-256 | 274551b458181c5adcdca1049ec3550bccf5a6b53d3f9ab884f6b98edc782ac3 |