deux - A high-level, asyncio-native library for Elgato Stream Deck devices.
Examples:
::
import asyncio
from deux import DeckManager
async def main():
manager = DeckManager()
@manager.on_connect()
async def handle(deck):
screen = deck.screen("main")
@screen.key(0).on_press
async def on_home():
print("Home pressed!")
await deck.set_screen("main")
async with manager:
await manager.wait_closed()
asyncio.run(main())
DeuxError
Bases: Exception
Root exception for every error raised by the deux library.
Source code in src/deux/_errors.py
| class DeuxError(Exception):
"""Root exception for every error raised by the deux library."""
|
SSRFError
Bases: DeuxError
Raised when a URL targets a blocked private/internal address.
Source code in src/deux/_url_safety.py
| class SSRFError(DeuxError):
"""Raised when a URL targets a blocked private/internal address."""
|
set_allow_private_urls
set_allow_private_urls(allow: bool) -> None
Opt in or out of private URL access.
Parameters:
| Name |
Type |
Description |
Default |
allow
|
bool
|
When True, SSRF checks are disabled and private/internal
URLs are permitted. When False (the default), requests to
loopback, RFC 1918, link-local, and metadata addresses are
blocked.
|
required
|
Source code in src/deux/_url_safety.py
| def set_allow_private_urls(allow: bool) -> None:
"""Opt in or out of private URL access.
Parameters
----------
allow : bool
When ``True``, SSRF checks are disabled and private/internal
URLs are permitted. When ``False`` (the default), requests to
loopback, RFC 1918, link-local, and metadata addresses are
blocked.
"""
global _allow_private_urls # noqa: PLW0603
_allow_private_urls = allow
|