pi_portal.modules.integrations.gpio.components.bases.monitor

GPIOMonitorBase class.

class pi_portal.modules.integrations.gpio.components.bases.monitor.GPIOMonitorBase(gpio_pins)[source]

GPIO input monitor class.

Parameters:

gpio_pins (Sequence[TypeVar(TypeGenericGpio, bound= GPIOInputBase)]) – A list of GPIO Inputs to monitor.

check_state_for_changes()[source]

Log any detected differences in state.

Return type:

None

configure_logger()

Configure a standardized logger for this class.

Return type:

None

abstract hook_log_state(gpio_pin)[source]

Override to log customized messages about a GPIO input state.

Parameters:

gpio_pin (TypeVar(TypeGenericGpio, bound= GPIOInputBase)) – A GPIO pin to log an event for.

Return type:

None

hook_setup_gpio()[source]

Initialize the GPIO mode, specific to the RPi library.

Return type:

None

is_running()[source]

Indicate if the polling loop is active. Override for testing.

Return type:

bool

start()[source]

Begin the monitoring loop.

Return type:

None

update_state()[source]

Poll GPIO and update the known state for the doors.

Return type:

None