-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1519442
commit 39dff31
Showing
3 changed files
with
68 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Copyright © 2024 Christian Bergschneider | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | ||
documentation files (the “Software”), to deal in the Software without restriction, including without limitation the | ||
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit | ||
persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the | ||
Software. | ||
|
||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE | ||
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR | ||
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,51 @@ | ||
# Client library for the ftSwarm Client API | ||
# 📚 Client library for the ftSwarm Serial API | ||
|
||
This library provides a simple interface to the ftSwarm Serial API in a python 3 way. | ||
|
||
## ⚙️ Installation | ||
|
||
To install the latest version of the library, run the following command: | ||
```bash | ||
pip install ftswarm-py | ||
``` | ||
|
||
## 🚲 Usage | ||
|
||
The library provides a simple interface to the ftSwarm Serial API. The following example shows how to connect to the ftSwarm and read a button named "button1" from the ftSwarm. | ||
|
||
```python | ||
import asyncio | ||
from swarm import FtSwarm | ||
|
||
|
||
async def read_button(): | ||
swarm = FtSwarm("/dev/ttyUSB0") # Change this to your serial port | ||
button = await swarm.get_button("button1") | ||
|
||
print(button.get_state()) | ||
|
||
asyncio.run(read_button()) | ||
``` | ||
|
||
Let's just go over the code above. The following steps are performed: | ||
- Creating an async context | ||
- Creating a FtSwarm object with the serial port as parameter | ||
- Getting the button named "button1" from the ftSwarm | ||
- Printing the state of the button | ||
|
||
Quite simple, right? | ||
|
||
Another simple example can be found at the quickstart section of the [documentation](https://bloeckchengrafik.de/ftswarm.py/quickstart/). | ||
|
||
## 📝 Documentation | ||
|
||
The library is documented using docstrings. You can also find the documentation on [my website](https://bloeckchengrafik.de/ftswarm.py/). | ||
|
||
## 🙆 Contributing | ||
|
||
If you want to contribute to the project, feel free to open a pull request. I will review it as soon as possible. | ||
Before adding large features, please open an issue first to discuss the feature, so that you don't waste your time. | ||
|
||
## ⚖️ License | ||
|
||
This project is licensed under the MIT license. You can find the license in the [LICENSE](LICENSE) file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
[tool.poetry] | ||
name = "ftswarm.py" | ||
version = "1.0.0" | ||
version = "1.1.0" | ||
description = "A Python library for the ftSwarm Python API" | ||
authors = ["bergschneider <[email protected]>"] | ||
readme = "README.md" | ||
documentation = "https://bloeckchengrafik.de/ftswarm.py/" | ||
|
||
license = "MIT" | ||
packages = [ | ||
{ include = "swarm" }, | ||
|