Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pisugar/pisugar-server-py
Python library to communicate with pisugar-server
https://github.com/pisugar/pisugar-server-py
Last synced: 7 days 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 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-01T13:31:42.000Z (7 months ago)
- Last Synced: 2024-10-28T22:28:53.690Z (17 days ago)
- Language: Python
- Size: 19.5 KB
- Stars: 9
- 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