Client
src.awtrix_light_client.http_client.get_awtrix_http_client
async
¶
get_awtrix_http_client()
Gives access to an instance of the Awtrix-light HTTP client
Returns:
Type | Description |
---|---|
AsyncIterator[AwtrixLightHttpClient]
|
An |
Source code in src/awtrix_light_client/http_client.py
265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 |
|
src.awtrix_light_client.http_client.AwtrixLightHttpClient ¶
AwtrixLightHttpClient(client)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
client
|
AsyncClient
|
|
required |
Source code in src/awtrix_light_client/http_client.py
33 34 35 36 37 |
|
get_stats
async
¶
get_stats()
General device stats (e.g., battery, RAM)
Returns:
Type | Description |
---|---|
Stats
|
Return a |
Source code in src/awtrix_light_client/http_client.py
55 56 57 58 59 60 61 62 |
|
get_effects
async
¶
get_effects()
List of all effects
Returns:
Type | Description |
---|---|
List[EffectType]
|
Return a list of |
Source code in src/awtrix_light_client/http_client.py
64 65 66 67 68 69 70 71 |
|
get_transitions
async
¶
get_transitions()
List of all transition effects
Returns:
Type | Description |
---|---|
List[TransitionType]
|
Return a list of |
Source code in src/awtrix_light_client/http_client.py
73 74 75 76 77 78 79 80 |
|
get_loops
async
¶
get_loops()
List of all apps in the loop
Returns:
Type | Description |
---|---|
Loop
|
Return a |
Source code in src/awtrix_light_client/http_client.py
82 83 84 85 86 87 88 89 90 91 |
|
get_screen
async
¶
get_screen()
Retrieve the current matrix screen as an array of 24 bit colors
Returns:
Type | Description |
---|---|
Screen
|
Return a |
Source code in src/awtrix_light_client/http_client.py
93 94 95 96 97 98 99 100 |
|
set_power
async
¶
set_power(power)
Toggle the matrix on or off
Parameters:
Name | Type | Description | Default |
---|---|---|---|
power
|
bool
|
Toggle the matrix |
required |
Source code in src/awtrix_light_client/http_client.py
102 103 104 105 106 107 |
|
set_sleep
async
¶
set_sleep(seconds)
Send the board in deep sleep mode (turns off the matrix as well), good for saving battery life
Parameters:
Name | Type | Description | Default |
---|---|---|---|
seconds
|
int
|
Duration of sleep mode |
required |
Source code in src/awtrix_light_client/http_client.py
109 110 111 112 113 114 |
|
set_sound
async
¶
set_sound(sound)
Play a RTTTL sound from the MELODIES folder
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sound
|
str
|
Sound to play |
required |
Source code in src/awtrix_light_client/http_client.py
116 117 118 119 120 121 |
|
set_rtttl
async
¶
set_rtttl(rtttl)
Play a RTTTL sound from a given RTTTL string
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sound
|
Sound to play in RTTTL format |
required |
Source code in src/awtrix_light_client/http_client.py
123 124 125 126 127 128 |
|
set_moodlight
async
¶
set_moodlight(moodlight)
Set the entire matrix to a custom color or temperature
Parameters:
Name | Type | Description | Default |
---|---|---|---|
moodlight
|
Moodlight
|
Custom color or temperature to set. To disable moodlight pass an empty object |
required |
Source code in src/awtrix_light_client/http_client.py
130 131 132 133 134 135 136 137 |
|
set_indicator
async
¶
set_indicator(indicator, color, blink=None, fade=None)
Colored indicators serve as small notification signs displayed on specific areas of the screen:
Parameters:
Name | Type | Description | Default |
---|---|---|---|
indicator
|
Literal[1, 2, 3]
|
Indicator (Upper right corner = 1, Right side = 2, Lower right corner = 3) |
required |
color
|
Color
|
Color to display. To hide the indicators pass black as Color |
required |
blink
|
int
|
Blink timer in milliseconds |
None
|
fade
|
int
|
Fade timer in milliseconds |
None
|
Source code in src/awtrix_light_client/http_client.py
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
|
set_custom_application
async
¶
set_custom_application(name, custom_application)
Set custom app or a list of custom app When erasing apps, AWTRIX doesn't match the exact app name. Instead, it identifies apps that begin with the specified name. To expunge all associated apps, send application=None. For example for name=test. This action will remove test0, test1, and so on. To eradicate a single app, direct the command to, for instance, test1
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of the application to manage |
required |
custom_application
|
Union[CustomApplication, List[CustomApplication], None]
|
An application, a list of application to setup or None |
required |
Source code in src/awtrix_light_client/http_client.py
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 |
|
notify
async
¶
notify(notification)
One-Time Notification
Parameters:
Name | Type | Description | Default |
---|---|---|---|
notification
|
Notification
|
Notification to display |
required |
Source code in src/awtrix_light_client/http_client.py
190 191 192 193 194 195 196 197 |
|
dismiss_notification
async
¶
dismiss_notification()
Easily dismiss a notification that was configured with "hold": true
Source code in src/awtrix_light_client/http_client.py
199 200 201 202 203 |
|
next_app
async
¶
next_app()
Navigate to the next app
Source code in src/awtrix_light_client/http_client.py
205 206 207 208 209 |
|
previous_app
async
¶
previous_app()
Navigate to the previous app
Source code in src/awtrix_light_client/http_client.py
211 212 213 214 215 |
|
switch_app
async
¶
switch_app(name)
Directly transition to a desired app using its name
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Application to switch to |
required |
Source code in src/awtrix_light_client/http_client.py
217 218 219 220 221 222 |
|
get_settings
async
¶
get_settings()
You can initiate the firmware update either through the update button in HA or using the following
Returns:
Type | Description |
---|---|
Settings
|
Return a |
Source code in src/awtrix_light_client/http_client.py
224 225 226 227 228 229 |
|
set_settings
async
¶
set_settings(s)
Adjust various settings related to the app display.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
s
|
Settings
|
Settings to update |
required |
Source code in src/awtrix_light_client/http_client.py
231 232 233 234 235 236 237 238 |
|
update
async
¶
update()
You can initiate the firmware update either through the update button in HA or using the following
Source code in src/awtrix_light_client/http_client.py
240 241 242 243 244 |
|
reboot
async
¶
reboot()
If you need to restart the Awtrix
Source code in src/awtrix_light_client/http_client.py
246 247 248 249 250 |
|
erase
async
¶
erase()
WARNING: This action will format the flash memory and EEPROM but will not modify the WiFi Settings. It essentially serves as a factory reset.
Source code in src/awtrix_light_client/http_client.py
252 253 254 255 256 |
|
reset_settings
async
¶
reset_settings()
WARNING: This action will reset all settings from the settings API. It does not reset the flash files and WiFi Settings.
Source code in src/awtrix_light_client/http_client.py
258 259 260 261 262 |
|