pi_portal.modules.integrations.gpio.components.door_monitor
DoorMonitor class.
- class pi_portal.modules.integrations.gpio.components.door_monitor.DoorMonitor(gpio_pins)[source]
Door contact switch monitor and logger.
- Parameters:
gpio_pins (
Sequence[TypeVar(TypeGenericGpio, bound=GPIOInputBase)]) – A list of GPIO Inputs to monitor.
- check_state_for_changes()
Log any detected differences in state.
- Return type:
None
- configure_logger()
Configure a standardized logger for this class.
- Return type:
None
- hook_log_state(gpio_pin)[source]
Log customized messages when a state change is detected.
- Parameters:
gpio_pin (
ContactSwitch) – A GPIO pin to log an event for.- Return type:
None
- hook_setup_gpio()
Initialize the GPIO mode, specific to the RPi library.
- Return type:
None
- is_running()
Indicate if the polling loop is active. Override for testing.
- Return type:
bool
- start()
Begin the monitoring loop.
- Return type:
None
- update_state()
Poll GPIO and update the known state for the doors.
- Return type:
None