poulet_py.hardware.triggers.gpio module#

class GPIOTrigger(*, name: str = '', timeout: float | None = None, pin: int, pull_up: bool = False, edge: Literal['rising', 'falling', 'both'] = 'rising')[source]#

Bases: BaseTrigger

GPIO-based trigger using gpiozero.

pin: int#
pull_up: bool#
edge: Literal['rising', 'falling', 'both']#
__init__(**data)[source]#

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

wait()[source]#

Wait for GPIO event.

Return type:

bool

cleanup()[source]#

Cleanup GPIO resources.

Return type:

None

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(context, /)#

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Return type:

None

Args:

self: The BaseModel instance. context: The context.

name: str#
timeout: float | None#