def METHOD_NAME(engine_store: "EngineStore") -> HardwareEventHandler:
    """Create a callback for estop events."""
    def _callback(event: HardwareEvent) -> None:
        if isinstance(event, EstopStateNotification):
            if event.new_state is not EstopState.PHYSICALLY_ENGAGED:
                return
            if engine_store.current_run_id is None:
                return
            engine_store.engine.estop(maintenance_run=False)
    return _callback