poulet_py.hardware.triggers package#
- class BaseTrigger(**data)[source]#
Bases:
BaseModel,ABCAbstract base class for trigger devices.
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
name:
str#
-
timeout:
float|None#
- class GPIOTrigger(*, name: str = '', timeout: float | None = None, pin: int, pull_up: bool = False, edge: Literal['rising', 'falling', 'both'] = 'rising')[source]#
Bases:
BaseTriggerGPIO-based trigger using gpiozero.
- __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.
- 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.
-
pin:
int#
-
pull_up:
bool#
-
edge:
Literal['rising','falling','both']#
- name: str#
- timeout: float | None#
- class KeyboardTrigger(**data)[source]#
Bases:
BaseTriggerKeyboard-based trigger (press Enter key).
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
-
key:
str#
- name: str#
- timeout: float | None#