Client Asynchrone
pypixelcolor.client.AsyncClient
Asynchronous client for controlling the LED matrix via BLE.
Source code in src/pypixelcolor/client.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | |
__aenter__()
async
Async context manager entry.
Source code in src/pypixelcolor/client.py
105 106 107 108 | |
__aexit__(exc_type, exc_val, exc_tb)
async
Async context manager exit.
Source code in src/pypixelcolor/client.py
110 111 112 | |
__init__(address)
Initialize the AsyncClient.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
address
|
str
|
Bluetooth device address (e.g., "1D:6B:5E:B5:A5:54") |
required |
Source code in src/pypixelcolor/client.py
54 55 56 57 58 59 60 61 | |
clear()
async
Clears the EEPROM.
Source code in src/pypixelcolor/client.py
36 37 38 | |
connect()
async
Connect to the BLE device and retrieve device info.
Source code in src/pypixelcolor/client.py
63 64 65 66 67 68 69 70 | |
delete(n)
async
Delete a specific screen by its index.
Source code in src/pypixelcolor/client.py
39 40 | |
disconnect()
async
Disconnect from the BLE device.
Source code in src/pypixelcolor/client.py
72 73 74 75 76 77 78 79 | |
get_device_info()
Get cached device information.
Device info is automatically retrieved during connect(). This is a simple getter for the cached data.
Returns:
| Type | Description |
|---|---|
DeviceInfo
|
DeviceInfo object with device specifications. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If not connected. |
Source code in src/pypixelcolor/client.py
85 86 87 88 89 90 91 92 93 94 95 96 97 98 | |
send_image(path, resize_method=ResizeMethod.CROP, device_info=None, save_slot=0)
async
Send an image or animation.
Source code in src/pypixelcolor/client.py
42 43 44 | |
send_image_hex(hex_string, file_extension, resize_method=ResizeMethod.CROP, device_info=None, save_slot=0)
async
Send an image or animation from a hexadecimal string.
Source code in src/pypixelcolor/client.py
45 46 | |
send_text(text, rainbow_mode=0, animation=0, save_slot=0, speed=80, color='ffffff', bg_color=None, font='CUSONG', char_height=None, device_info=None)
async
Send a text to the device with configurable parameters.
Source code in src/pypixelcolor/client.py
48 | |
set_brightness(level)
async
Set the brightness of the device.
Source code in src/pypixelcolor/client.py
51 52 | |
set_clock_mode(style=1, date='', show_date=True, format_24=True)
async
Set the clock mode of the device.
Source code in src/pypixelcolor/client.py
54 55 | |
set_fun_mode(enable=False)
async
Enable or disable fun mode.
Source code in src/pypixelcolor/client.py
57 58 59 | |
set_orientation(orientation=0)
async
Set the orientation of the device.
Source code in src/pypixelcolor/client.py
60 61 | |
set_pixel(x, y, color, device_info=None)
async
Defines the color of a specific pixel.
Source code in src/pypixelcolor/client.py
63 64 65 | |
set_power(on=True)
async
Set the power state of the device.
Source code in src/pypixelcolor/client.py
66 67 | |
set_rhythm_mode(style=0, l1=0, l2=0, l3=0, l4=0, l5=0, l6=0, l7=0, l8=0, l9=0, l10=0, l11=0)
async
Set the rhythm mode of the device.
Source code in src/pypixelcolor/client.py
69 70 | |
set_rhythm_mode_2(style=0, t=0)
async
Set the rhythm mode of the device (alternative version).
Source code in src/pypixelcolor/client.py
72 73 74 | |
set_time(hour=None, minute=None, second=None)
async
Set the device time.
Source code in src/pypixelcolor/client.py
75 76 | |
show_slot(number)
async
Shows the specified slot on the device.
Source code in src/pypixelcolor/client.py
78 79 | |
version()
Get the client library version.
Source code in src/pypixelcolor/client.py
81 82 83 | |