https://github.com/phillychi3/dglab-v3-python
dgalb v3 python lib
https://github.com/phillychi3/dglab-v3-python
dg-lab dglab
Last synced: 6 months ago
JSON representation
dgalb v3 python lib
- Host: GitHub
- URL: https://github.com/phillychi3/dglab-v3-python
- Owner: phillychi3
- License: gpl-3.0
- Created: 2024-10-17T16:16:31.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-09-15T12:51:44.000Z (10 months ago)
- Last Synced: 2025-09-30T12:29:20.734Z (10 months ago)
- Topics: dg-lab, dglab
- Language: Python
- Homepage:
- Size: 106 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# DGLAB V3 webhook
僅提供客戶端\
並無伺服端功能
> [!Warning]
> 絕讚開發中,測試尚未編寫完全
## 安裝
```bash
pip install --upgrade dglabv3
```
## 簡單範例
```python
import asyncio
from dglabv3 import dglabv3
from dglabv3 import Channel, StrengthType, Pulse
client = dglabv3()
async def run():
try:
await client.connect_and_wait(timeout=30)
print(client.generate_qrcode_text())
await client.wait_for_app_connect(timeout=60)
await client.set_strength_value(Channel.A, 20)
await asyncio.sleep(1)
await client.send_wave_message(Pulse().breath, 30, Channel.A)
except Exception as e:
print(f"An error occurred: {e}")
exit(1)
finally:
await client.close()
if __name__ == "__main__":
asyncio.run(run())
```
> [!Note]
> 如果發現無法設置到自己想要的強度,請檢察目前最高強度在哪裡,預設是 40 秒+1 最大上限,可以手動拉高