GPIOResource¶
GPIOResource
¶
GPIO channel management for PiKVM.
Source code in src/aiopikvm/resources/gpio.py
get_state()
async
¶
Get the current GPIO state.
Returns:
| Type | Description |
|---|---|
GPIOState
|
Current GPIO subsystem state with inputs and outputs. |
switch(channel, state, *, wait=False, timeout=None)
async
¶
Set a GPIO output channel state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
channel
|
str
|
Channel name. |
required |
state
|
bool
|
Desired state ( |
required |
wait
|
bool
|
Answer only once the switch has finished. Without it kvmd
replies as soon as the action starts and writes anything that
goes wrong after that — an offline driver, most of all — to
its own log only. A busy channel is reported either way.
Defaults to |
False
|
timeout
|
float | None
|
Per-call timeout in seconds. Only meaningful with
|
None
|
Raises:
| Type | Description |
|---|---|
BusyError
|
The channel is already running another action (409).
Raised with or without |
APIError
|
No such channel, or the channel is not switchable (400).
With |
Source code in src/aiopikvm/resources/gpio.py
pulse(channel, delay=None, *, wait=False, timeout=None)
async
¶
Send a pulse to a GPIO channel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
channel
|
str
|
Channel name. |
required |
delay
|
float | None
|
Pulse duration in seconds. |
None
|
wait
|
bool
|
Answer only once the pulse has finished. Without it kvmd replies as soon as the pulse starts and writes anything that goes wrong after that — an offline driver, most of all — to its own log only. A busy channel is reported either way. |
False
|
timeout
|
float | None
|
Per-call timeout in seconds. A pulse with |
None
|
Raises:
| Type | Description |
|---|---|
BusyError
|
The channel is already running another action (409).
Raised with or without |
APIError
|
No such channel, or the channel does not support pulsing
because its |