https://github.com/mishamyrt/myrt_desk_api
🧠MyrtDesk API and CLI tool
https://github.com/mishamyrt/myrt_desk_api
asyncio iot udp
Last synced: over 1 year ago
JSON representation
🧠MyrtDesk API and CLI tool
- Host: GitHub
- URL: https://github.com/mishamyrt/myrt_desk_api
- Owner: mishamyrt
- License: gpl-3.0
- Created: 2022-11-09T17:55:08.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-09T09:27:59.000Z (about 2 years ago)
- Last Synced: 2025-01-07T11:50:40.572Z (over 1 year ago)
- Topics: asyncio, iot, udp
- Language: Python
- Homepage:
- Size: 92.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MyrtDesk API [](https://pypi.org/project/myrt-desk-api/)
Library for controlling smart table functions with my own [firmware](https://github.com/mishamyrt/myrt_desk_firmware).
* **Fully asynchronous**
* Automatic detection
* Cool CLI tool
## API Example
This code will wait for the lights to turn off, then flash the backlight controller and then turn on the rainbow effect:
```py
from asyncio import run
from myrt_desk_api import MyrtDesk, Effect
async def main():
desk_host = await discover()
desk = MyrtDesk(desk_host)
await desk.backlight.set_power(False)
with open("./firmware.hex", mode="rb") as file:
await desk.backlight.update_firmware(file.read())
await desk.backlight.set_effect(Effect.RAINBOW)
if __name__ == '__main__':
run(main())
```