API reference¶
mister_fpga.MisterClient ¶
Async REST client for the MiSTer FPGA mrext Remote API.
Wraps every endpoint exposed by the mrext Remote service under
http://host:port/api. All network I/O is non-blocking; methods raise
:class:MisterConnectionError on any network or HTTP error.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
host
|
str
|
IP address or hostname of the MiSTer device. |
required |
port
|
int
|
mrext Remote port (default |
8182
|
session
|
ClientSession | None
|
Optional shared |
None
|
timeout
|
int
|
Per-request timeout in seconds (default |
10
|
Source code in src/mister_fpga/client.py
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 | |
async_close
async
¶
async_close() -> None
Close the underlying HTTP session if this client created it.
Source code in src/mister_fpga/client.py
189 190 191 192 193 | |
async_get_status
async
¶
async_get_status() -> MisterStatus
Fetch a combined sysinfo + playing snapshot.
Returns:
| Name | Type | Description |
|---|---|---|
A |
MisterStatus
|
class: |
Raises:
| Type | Description |
|---|---|
MisterConnectionError
|
If either underlying request fails. |
Source code in src/mister_fpga/client.py
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 | |
async_get_systems
async
¶
async_get_systems() -> list[dict]
Return the list of systems known to mrext.
Source code in src/mister_fpga/client.py
270 271 272 | |
async_launch_system
async
¶
async_launch_system(system_id: str) -> None
Launch the default game/core for system_id.
Source code in src/mister_fpga/client.py
274 275 276 | |
async_launch_game
async
¶
async_launch_game(path: str) -> None
Launch a game by its absolute path on the MiSTer SD card.
Source code in src/mister_fpga/client.py
278 279 280 | |
async_launch_menu
async
¶
async_launch_menu() -> None
Return to the MiSTer main menu.
Source code in src/mister_fpga/client.py
282 283 284 | |
async_search_games
async
¶
async_search_games(query: str, system: str = 'all', page: int | None = None) -> dict
Search the game index.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
Free-text search string. |
required |
system
|
str
|
Limit results to a system id, or |
'all'
|
page
|
int | None
|
1-based result page (Remote >= 0.5 paginates; 0.4 ignores it and caps results at 500). |
None
|
Returns:
| Type | Description |
|---|---|
dict
|
``{"data": [{"system": {...}, "name", "path"}], "total", |
dict
|
"pageSize", "page"}``. |
Source code in src/mister_fpga/client.py
286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 | |
async_get_search_systems
async
¶
async_get_search_systems() -> list[dict]
Return the systems present in the game index ([{id, name}]).
Source code in src/mister_fpga/client.py
306 307 308 309 | |
async_browse_games
async
¶
async_browse_games(path: str | None = None) -> dict
List a games folder ({"up", "items"}); root when path is None.
Source code in src/mister_fpga/client.py
311 312 313 314 | |
async_browse_menu
async
¶
async_browse_menu(path: str = '') -> dict
List a folder of the MiSTer menu tree ({"up", "items": [...]}).
Raises:
| Type | Description |
|---|---|
ValueError
|
If path contains |
Source code in src/mister_fpga/client.py
316 317 318 319 320 321 322 323 324 325 326 327 | |
async_index_games
async
¶
async_index_games() -> None
Trigger a background re-index of the game library.
Source code in src/mister_fpga/client.py
329 330 331 | |
async_send_keyboard
async
¶
async_send_keyboard(name: str) -> None
Send a named virtual-keyboard event (see KEYBOARD_NAMES).
Source code in src/mister_fpga/client.py
333 334 335 | |
async_reboot
async
¶
async_reboot() -> None
Reboot the MiSTer device.
Source code in src/mister_fpga/client.py
337 338 339 | |
async_restart_remote
async
¶
async_restart_remote() -> None
Restart the mrext Remote service on the MiSTer.
Source code in src/mister_fpga/client.py
341 342 343 | |
async_take_screenshot
async
¶
async_take_screenshot() -> None
Capture a screenshot on the MiSTer and save it server-side.
Source code in src/mister_fpga/client.py
345 346 347 | |
async_get_screenshots
async
¶
async_get_screenshots() -> list[dict]
Return metadata for all saved screenshots.
Source code in src/mister_fpga/client.py
349 350 351 352 | |
async_get_screenshot_image
async
¶
async_get_screenshot_image(core: str, filename: str) -> bytes
Download a screenshot image as raw bytes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
core
|
str
|
Core name sub-directory (e.g. |
required |
filename
|
str
|
Screenshot filename within that sub-directory. |
required |
Returns:
| Type | Description |
|---|---|
bytes
|
Raw image bytes (typically PNG). |
Raises:
| Type | Description |
|---|---|
MisterConnectionError
|
If the image cannot be retrieved. |
Source code in src/mister_fpga/client.py
354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 | |
async_delete_screenshot
async
¶
async_delete_screenshot(core: str, filename: str) -> None
Delete one saved screenshot.
Source code in src/mister_fpga/client.py
371 372 373 374 375 | |
async_get_music_status
async
¶
async_get_music_status() -> dict
Return the current music-player status dict.
Source code in src/mister_fpga/client.py
377 378 379 | |
async_music_play
async
¶
async_music_play() -> None
Start or resume music playback.
Source code in src/mister_fpga/client.py
381 382 383 | |
async_music_stop
async
¶
async_music_stop() -> None
Stop music playback.
Source code in src/mister_fpga/client.py
385 386 387 | |
async_music_next
async
¶
async_music_next() -> None
Skip to the next track.
Source code in src/mister_fpga/client.py
389 390 391 | |
async_get_wallpapers
async
¶
async_get_wallpapers() -> dict
Return available wallpapers and the currently active one.
Source code in src/mister_fpga/client.py
394 395 396 | |
async_set_wallpaper
async
¶
async_set_wallpaper(filename: str) -> None
Set the active wallpaper by filename.
Source code in src/mister_fpga/client.py
398 399 400 | |
async_clear_wallpaper
async
¶
async_clear_wallpaper() -> None
Remove the active wallpaper (revert to default).
Source code in src/mister_fpga/client.py
402 403 404 | |
async_get_inis
async
¶
async_get_inis() -> dict
Return a list of MiSTer.ini profiles and the active index.
Source code in src/mister_fpga/client.py
407 408 409 | |
async_get_ini_values
async
¶
async_get_ini_values(ini_id: int) -> dict
Return all key/value pairs for INI profile ini_id.
Source code in src/mister_fpga/client.py
411 412 413 | |
async_set_active_ini
async
¶
async_set_active_ini(ini_id: int) -> None
Switch the active MiSTer.ini profile to ini_id.
Source code in src/mister_fpga/client.py
415 416 417 | |
async_set_ini_values
async
¶
async_set_ini_values(ini_id: int, values: dict) -> None
Update key/value pairs in INI profile ini_id.
Source code in src/mister_fpga/client.py
419 420 421 | |
async_set_background_mode
async
¶
async_set_background_mode(mode: int) -> None
Set the menu background mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
int
|
One of :data: |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
For any other value (the server rejects odd modes). |
Source code in src/mister_fpga/client.py
423 424 425 426 427 428 429 430 431 432 433 434 435 436 | |
async_get_music_playlists
async
¶
async_get_music_playlists() -> list[str]
Return the list of available music playlist names.
Source code in src/mister_fpga/client.py
439 440 441 | |
async_set_music_playlist
async
¶
async_set_music_playlist(name: str) -> None
Activate the music playlist identified by name.
Source code in src/mister_fpga/client.py
443 444 445 | |
async_set_music_playback
async
¶
async_set_music_playback(mode: str) -> None
Set playback mode (e.g. "random", "loop").
Source code in src/mister_fpga/client.py
447 448 449 | |
async_get_scripts
async
¶
async_get_scripts() -> dict
Return the list of user scripts available on the MiSTer.
Source code in src/mister_fpga/client.py
452 453 454 | |
async_launch_script
async
¶
async_launch_script(filename: str) -> None
Launch a user script by its filename.
Source code in src/mister_fpga/client.py
456 457 458 | |
async_open_console
async
¶
async_open_console() -> None
Open the MiSTer console (script terminal).
Source code in src/mister_fpga/client.py
460 461 462 | |
async_kill_script
async
¶
async_kill_script() -> None
Kill the currently running user script.
Source code in src/mister_fpga/client.py
464 465 466 | |
async_get_peers
async
¶
async_get_peers() -> list[dict]
Return the list of mrext Remote peers on the local network.
Source code in src/mister_fpga/client.py
469 470 471 472 | |
async_launch_path
async
¶
async_launch_path(path: str) -> None
Launch a file (ROM, core, script) by its absolute SD-card path.
Source code in src/mister_fpga/client.py
475 476 477 | |
async_launch_token
async
¶
async_launch_token(data: str) -> None
Launch a token: a path, or a **command: such as **random:snes.
The text is base64url-encoded (no padding) as the /l/<data>
endpoint requires; pass it in plain form.
Source code in src/mister_fpga/client.py
479 480 481 482 483 484 485 486 | |
async_create_shortcut
async
¶
async_create_shortcut(game_path: str, folder: str, name: str) -> dict
Create a game shortcut in the Favourites/Recents folder.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
game_path
|
str
|
Absolute path to the game ROM on the SD card. |
required |
folder
|
str
|
Target folder name (e.g. |
required |
name
|
str
|
Display name for the shortcut. |
required |
Returns:
| Type | Description |
|---|---|
dict
|
A dict describing the created shortcut entry. |
Source code in src/mister_fpga/client.py
488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 | |
async_send_keyboard_raw
async
¶
async_send_keyboard_raw(code: int) -> None
Tap a Linux evdev KEY_* code (e.g. 28 = Enter).
A negative code sends Shift + abs(code).
Source code in src/mister_fpga/client.py
508 509 510 511 512 513 | |
async_get_screen
async
¶
async_get_screen() -> dict
Return the current framebuffer resolution {width, height}.
Source code in src/mister_fpga/client.py
516 517 518 | |
async_get_playlog_status
async
¶
async_get_playlog_status() -> dict
PlayLog state: {installed, running, database, recents, startup}.
Source code in src/mister_fpga/client.py
520 521 522 | |
async_get_playlog_summary
async
¶
async_get_playlog_summary(*, top: int | None = None, days: int | None = None) -> dict
Play-time summary: totals (seconds), streaks, top games/systems, per-day.
Source code in src/mister_fpga/client.py
524 525 526 527 528 529 530 531 532 | |
async_get_playlog_games
async
¶
async_get_playlog_games(*, sort: str | None = None, limit: int | None = None, offset: int = 0) -> dict
Per-game play stats {"games": [...], "total"}.
Source code in src/mister_fpga/client.py
534 535 536 537 538 539 540 541 542 543 544 545 546 | |
async_get_playlog_sessions
async
¶
async_get_playlog_sessions(*, limit: int | None = None, offset: int = 0) -> dict
Recent play sessions {"sessions": [...], "total"}.
Source code in src/mister_fpga/client.py
548 549 550 551 552 553 | |
async_get_remote_log
async
¶
async_get_remote_log() -> bytes
Download the Remote service log.
Source code in src/mister_fpga/client.py
555 556 557 | |
mister_fpga.MisterStatus
dataclass
¶
Snapshot of the MiSTer device state at a point in time.
Returned by :meth:MisterClient.async_get_status and mutated in-place by
:func:~mister_fpga.apply_ws_message.
Attributes:
| Name | Type | Description |
|---|---|---|
online |
bool
|
|
core |
str | None
|
Short core identifier (e.g. |
system |
str | None
|
System slug used by mrext (e.g. |
system_name |
str | None
|
Human-readable system name (e.g. |
game |
str | None
|
Running game as |
game_name |
str | None
|
Basename of the game without extension, or |
hostname |
str | None
|
MiSTer hostname as reported by the Remote API. |
version |
str | None
|
mrext Remote version string. |
ip |
str | None
|
Primary IP address of the MiSTer device. |
ips |
list[str]
|
All IP addresses reported by the device. |
updated |
str | None
|
ISO-8601 timestamp of the last sysinfo update. |
updated |
str | None
|
Time of the last MiSTer update, not of this snapshot. |
dns |
str | None
|
|
disk_total |
int | None
|
Total SD-card space in bytes. |
disk_used |
int | None
|
Used SD-card space in bytes. |
disk_free |
int | None
|
Free SD-card space in bytes. |
disks |
list[dict]
|
Every disk reported by sysinfo (SD card, USB drives, ...). |
core_session_time |
int | None
|
Seconds the current core has been running
(Remote >= 0.5, else |
game_session_time |
int | None
|
Seconds the current game has been running
(Remote >= 0.5, else |
Source code in src/mister_fpga/client.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | |
is_running_game
property
¶
is_running_game: bool
True when a real core/game (not the menu) is running.
mister_fpga.MisterWebSocketClient ¶
Reconnecting WebSocket client for real-time MiSTer Remote events.
Connects to the mrext Remote WebSocket endpoint and invokes a callback for every TEXT frame received. If the connection drops the client waits reconnect_delay seconds and reconnects automatically.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
host
|
str
|
IP address or hostname of the MiSTer device. |
required |
port
|
int
|
mrext Remote port (default |
8182
|
session
|
ClientSession | None
|
Optional shared |
None
|
reconnect_delay
|
int
|
Seconds to wait before reconnecting after a
connection loss (default |
5
|
Source code in src/mister_fpga/websocket.py
138 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 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 | |
listen
async
¶
listen(on_message: Callable[[str], None | Awaitable[None]]) -> None
Run the reconnect loop, calling on_message for each TEXT frame.
Blocks until :meth:stop is called or the task is cancelled.
on_message may be a plain function or a coroutine function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
on_message
|
Callable[[str], None | Awaitable[None]]
|
Callable |
required |
Source code in src/mister_fpga/websocket.py
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 | |
async_send
async
¶
async_send(message: str) -> None
Send a raw command frame on the open connection.
Server commands: getIndexStatus, kbd:<name>, kbdRaw:<code>,
kbdRawDown:<code> / kbdRawUp:<code> (hold a key), and on
Remote >= 0.5 mouseMove/mousePos/mouseBtn. Unknown
commands are answered with an invalid frame.
Raises:
| Type | Description |
|---|---|
ConnectionError
|
If not connected. |
Source code in src/mister_fpga/websocket.py
220 221 222 223 224 225 226 227 228 229 230 231 232 233 | |
stop ¶
stop() -> None
Signal the :meth:listen loop to exit after the current iteration.
Source code in src/mister_fpga/websocket.py
235 236 237 | |
mister_fpga.apply_ws_message ¶
apply_ws_message(message: str, status: MisterStatus, menu_path: str | None, index_state: tuple[bool, bool]) -> tuple[MisterStatus, str | None, tuple[bool, bool]]
Apply one WebSocket text frame to the current state triple.
This is a pure reducer — it never mutates its arguments. Pass it every
raw text frame received from :class:MisterWebSocketClient to keep a
local :class:~mister_fpga.MisterStatus in sync without polling the REST
API.
Understood prefixes (prefix:rest):
coreRunning— updates :attr:~mister_fpga.MisterStatus.core; switching from another core clears the stale system and game fields (a launch from the menu sendsgameRunningfirst, so that is kept).gameRunning— updates :attr:~mister_fpga.MisterStatus.gameand :attr:~mister_fpga.MisterStatus.game_name(<system>/<file>, or the bare core name for arcade).menuNavigation— updates menu_path toFULLPATH/CURRENTPATH(see :func:split_menu_navigationfor the parts).indexStatus— updates index_state(exists, in_progress); use :func:parse_index_statusfor the progress fields.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
str
|
Raw text frame received from the WebSocket. |
required |
status
|
MisterStatus
|
Current device-state snapshot. |
required |
menu_path
|
str | None
|
Current menu navigation path, or |
required |
index_state
|
tuple[bool, bool]
|
Tuple |
required |
Returns:
| Type | Description |
|---|---|
MisterStatus
|
A new |
str | None
|
change encoded in message. Unrecognised prefixes are passed through |
tuple[bool, bool]
|
unchanged. |
Source code in src/mister_fpga/websocket.py
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 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | |
mister_fpga.MisterSSH ¶
Persistent asyncssh connection for MiSTer telemetry probes.
Maintains a single SSH connection that is re-established transparently on
failure. SSH telemetry is strictly best-effort: :meth:async_probe
always returns a dict (possibly empty) and never raises.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
host
|
str
|
IP address or hostname of the MiSTer device. |
required |
port
|
int
|
SSH port (default |
required |
username
|
str
|
SSH username (default |
required |
password
|
str
|
SSH password (often |
required |
Source code in src/mister_fpga/ssh.py
128 129 130 131 132 133 134 135 136 137 138 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 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | |
async_run
async
¶
async_run(command: str, timeout: int = 15) -> tuple[int, str]
Run a command over the shared SSH connection.
Returns (exit_status, stdout). Raises on connection/transport
failure (callers that need best-effort behaviour must catch).
Source code in src/mister_fpga/ssh.py
161 162 163 164 165 166 167 168 169 170 171 172 173 174 | |
async_probe
async
¶
async_probe() -> dict
Run the SSH probe command and return parsed telemetry.
Source code in src/mister_fpga/ssh.py
176 177 178 179 180 181 182 183 | |
async_send_command
async
¶
async_send_command(command: str) -> None
Queue one command on /dev/MiSTer_cmd without ever blocking.
Main reads the FIFO only while its loop is alive, so a plain echo
hangs forever when Main is stuck. The write here is non-blocking and
fails fast instead.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
command
|
str
|
e.g. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If command is empty or contains a newline. |
MisterMainUnresponsiveError
|
If the FIFO is full or missing. |
Source code in src/mister_fpga/ssh.py
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | |
async_set_volume
async
¶
async_set_volume(level: int) -> None
Set master volume, 0-7 (7 loudest).
Source code in src/mister_fpga/ssh.py
209 210 211 212 213 | |
async_set_mute
async
¶
async_set_mute(muted: bool) -> None
Mute or unmute master audio.
Source code in src/mister_fpga/ssh.py
215 216 217 | |
async_close
async
¶
async_close() -> None
Close the underlying SSH connection if open.
Source code in src/mister_fpga/ssh.py
219 220 221 222 223 | |
mister_fpga.parse_ssh_probe ¶
parse_ssh_probe(raw: str) -> dict
Parse the batched SSH probe output into a telemetry dict.
The probe command (SSH_PROBE_CMD) concatenates eleven fields separated
by |||. Any missing or malformed field is silently coerced to
None, so output from an older probe still parses.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raw
|
str
|
Raw stdout string returned by running |
required |
Returns:
| Type | Description |
|---|---|
dict
|
A dict with the following keys: |
dict
|
|
dict
|
|
dict
|
|
dict
|
|
dict
|
|
dict
|
|
dict
|
|
dict
|
|
dict
|
|
dict
|
|
dict
|
|
dict
|
|
dict
|
|
dict
|
hung (its loop also drains |
dict
|
leak one descriptor per core load; the limit is 1024. |
Source code in src/mister_fpga/ssh.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 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 | |
mister_fpga.MisterConnectionError ¶
Bases: Exception
Raised when the MiSTer Remote API is unreachable or returns an error.
This exception wraps aiohttp.ClientError, TimeoutError, and
invalid-JSON responses so callers have a single exception type to catch.
Source code in src/mister_fpga/client.py
58 59 60 61 62 63 | |
mister_fpga.MisterUnsupportedError ¶
Bases: MisterConnectionError
The endpoint does not exist on this Remote version.
mrext Remote answers unknown /api routes (or a wrong HTTP method) with
its web UI, 200 text/html, instead of a 404.
Source code in src/mister_fpga/client.py
66 67 68 69 70 71 | |
mister_fpga.MisterMainUnresponsiveError ¶
Bases: Exception
Main_MiSTer is not draining /dev/MiSTer_cmd; the command was not queued.
Source code in src/mister_fpga/ssh.py
103 104 | |
mister_fpga.MisterGamepad ¶
Client for the Companion Remote virtual controller.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
host
|
str
|
MiSTer IP or hostname. |
required |
port
|
int
|
Daemon port (default 9191). |
DEFAULT_GAMEPAD_PORT
|
path
|
str
|
WebSocket path (default |
DEFAULT_GAMEPAD_PATH
|
session
|
ClientSession | None
|
Optional shared |
None
|
timeout
|
float
|
Seconds for the whole exchange (connect + replies). |
5
|
Source code in src/mister_fpga/gamepad.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 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 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | |
async_available
async
¶
async_available() -> bool
True when the daemon answers GET /status.
Source code in src/mister_fpga/gamepad.py
65 66 67 68 69 70 71 72 73 74 75 76 77 | |
async_send
async
¶
async_send(*commands: dict[str, Any]) -> list[dict]
Send raw daemon commands over one connection and return the replies.
Raises:
| Type | Description |
|---|---|
MisterGamepadError
|
On connection failure or an |
Source code in src/mister_fpga/gamepad.py
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 | |
async_press
async
¶
async_press(button: str, action: str = 'tap') -> None
Press a controller button or D-pad direction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
button
|
str
|
One of :data: |
required |
action
|
str
|
|
'tap'
|
Source code in src/mister_fpga/gamepad.py
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | |
async_key
async
¶
async_key(key: str, action: str = 'tap') -> None
Press a virtual keyboard key by evdev name, e.g. "KEY_F12".
Source code in src/mister_fpga/gamepad.py
121 122 123 124 125 126 127 | |
mister_fpga.MisterGamepadError ¶
Bases: Exception
The daemon is unreachable or rejected a command.
Source code in src/mister_fpga/gamepad.py
30 31 | |
mister_fpga.MisterIndexStatus
dataclass
¶
Game-index state carried by indexStatus: frames.
Source code in src/mister_fpga/websocket.py
17 18 19 20 21 22 23 24 25 | |
mister_fpga.parse_index_status ¶
parse_index_status(rest: str) -> MisterIndexStatus
Parse the payload of indexStatus:<y|n>,<y|n>,<total>,<current>,<desc>.
Source code in src/mister_fpga/websocket.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | |
mister_fpga.split_menu_navigation ¶
split_menu_navigation(rest: str) -> tuple[str | None, str | None]
Split menuNavigation:<FULLPATH>:<CURRENTPATH> into its two parts.
FULLPATH is the folder open in the menu, CURRENTPATH the highlighted
entry. Older senders without the separator yield (rest, None).
Source code in src/mister_fpga/websocket.py
48 49 50 51 52 53 54 55 56 57 | |
mister_fpga.parse_volume ¶
parse_volume(raw: int | None) -> tuple[int | None, bool | None]
Decode /media/fat/config/Volume.dat into (level, muted).
Bits 0-2 hold the attenuation (0 = loudest, 7 = quietest) and bit 4 the
mute flag. level is returned the other way round, 0-7 with 7 loudest,
which is also what the volume <n> FIFO command expects.
Source code in src/mister_fpga/ssh.py
107 108 109 110 111 112 113 114 115 116 | |
mister_fpga.parse_ra_log ¶
parse_ra_log(text: str) -> list[dict]
Turn /tmp/ra_debug.log lines into events.
odelot's Main only writes this log with debug=1 in
retroachievements.cfg. game_id and game_title lines follow a
=== GAME IDENTIFIED === header and are merged into one
game_identified event.
Returns:
| Type | Description |
|---|---|
list[dict]
|
Dicts with a |
list[dict]
|
|
list[dict]
|
plus the captured fields; numeric fields are ints. |
Source code in src/mister_fpga/ra.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | |
mister_fpga.MisterRA ¶
RetroAchievements local control sharing a MisterSSH connection.
Source code in src/mister_fpga/ra.py
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 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 169 170 171 | |
async_status
async
¶
async_status() -> MisterRAStatus | None
Probe RA state. Returns None only on SSH failure (best-effort).
Source code in src/mister_fpga/ra.py
118 119 120 121 122 123 124 125 | |
async_read_log
async
¶
async_read_log(offset: int = 0) -> tuple[int, list[dict]]
Read new RA log events written since offset.
Returns:
| Type | Description |
|---|---|
int
|
|
list[dict]
|
Main restarts the log is truncated; the offset then resets to 0. |
Source code in src/mister_fpga/ra.py
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | |
async_set_debug
async
¶
async_set_debug(enabled: bool) -> None
Turn RA debug logging on/off (applies on the next core load).
Source code in src/mister_fpga/ra.py
159 160 161 162 163 164 165 166 | |
mister_fpga.MisterRAWeb ¶
Async client for the public RetroAchievements.org Web API.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
username
|
str
|
RA account username (used for both |
required |
api_key
|
str
|
RA Web API key ( |
required |
session
|
ClientSession | None
|
Optional shared |
None
|
timeout
|
int
|
Per-request timeout in seconds (default |
15
|
Source code in src/mister_fpga/ra_web.py
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 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 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 | |
async_close
async
¶
async_close() -> None
Close the HTTP session if this client created it.
Source code in src/mister_fpga/ra_web.py
133 134 135 136 137 | |
async_fetch_stats
async
¶
async_fetch_stats() -> MisterRAWebStats
Fetch all cloud stats concurrently and assemble them.
Source code in src/mister_fpga/ra_web.py
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 | |
async_validate
async
¶
async_validate() -> None
Verify credentials with a lightweight call. Raises on failure.
Source code in src/mister_fpga/ra_web.py
201 202 203 | |
async_get_badge_image
async
¶
async_get_badge_image(url: str) -> bytes
Fetch a badge/icon image by absolute URL.
Source code in src/mister_fpga/ra_web.py
205 206 207 208 209 210 211 212 213 214 215 | |
mister_fpga.MisterRAWebStats
dataclass
¶
Aggregated RetroAchievements cloud player stats.
Source code in src/mister_fpga/const.py
180 181 182 183 184 185 186 187 188 189 190 | |
mister_fpga.RAGameProgress
dataclass
¶
Per-game achievement progress from the RA Web API.
Source code in src/mister_fpga/const.py
154 155 156 157 158 159 160 161 162 163 164 165 | |
mister_fpga.RAAchievement
dataclass
¶
A single unlocked achievement from the RA Web API.
Source code in src/mister_fpga/const.py
168 169 170 171 172 173 174 175 176 177 | |
mister_fpga.MisterRAWebError ¶
Bases: Exception
A RetroAchievements Web API request failed (network, HTTP, or auth).
Source code in src/mister_fpga/ra_web.py
99 100 | |