https://github.com/pisugar/pisugar-server-py
Python library to communicate with pisugar-server
https://github.com/pisugar/pisugar-server-py
Last synced: 12 months ago
JSON representation
Python library to communicate with pisugar-server
- Host: GitHub
- URL: https://github.com/pisugar/pisugar-server-py
- Owner: PiSugar
- License: apache-2.0
- Created: 2022-03-05T07:07:52.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-05-01T13:31:42.000Z (about 2 years ago)
- Last Synced: 2025-06-18T07:53:24.668Z (12 months ago)
- Language: Python
- Size: 19.5 KB
- Stars: 12
- Watchers: 4
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pisugar-server-py
Python library to communicate with pisugar-server.
## Requirements
python 3.5+
## Usage
Installation
pip3 install pisugar
Python test code
from pisugar import test_via_tcp
test_via_tcp()
Python example
from pisugar import *
conn, event_conn = connect_tcp('raspberrypi.local')
s = PiSugarServer(conn, event_conn)
s.register_single_tap_handler(lambda: print('single'))
s.register_double_tap_handler(lambda: print('double'))
version = s.get_version()
NOTE: The tap event callback should not block the thread
## License
Apache License Version 2.0