Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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